Patchwork [Bug,4129] New: test-module-imports.t fails when run inside virtualenv

login
register
mail settings
Submitter mercurial-bugs@selenic.com
Date Dec. 11, 2013, 1:30 a.m.
Message ID <bug-4129-285@http.bz.selenic.com/>
Download mbox | patch
Permalink /patch/3211/
State Superseded
Headers show

Comments

mercurial-bugs@selenic.com - Dec. 11, 2013, 1:30 a.m.
http://bz.selenic.com/show_bug.cgi?id=4129

          Priority: normal
            Bug ID: 4129
                CC: mercurial-devel@selenic.com
          Assignee: bugzilla@selenic.com
           Summary: test-module-imports.t fails when run inside virtualenv
          Severity: bug
    Classification: Unclassified
                OS: Mac OS
          Reporter: chris.jerdonek@gmail.com
          Hardware: Macintosh
            Status: UNCONFIRMED
           Version: 2.8
         Component: Mercurial
           Product: Mercurial

test-module-imports.t fails for me when I run the test from inside a
virtualenv.  All the other tests pass inside a virtualenv.  This happens for me
running from the current tip of stable 1c92524c37cd on Mac 10.8.5 with Python
2.7.6.

This was previously reported on the mailing list:
http://www.selenic.com/pipermail/mercurial-devel/2013-December/055197.html

$ python run-tests.py test-module-imports.t 

+  [1]

   $ cd "$TESTDIR"/..
   $ if hg identify -q > /dev/null 2>&1; then :
@@ -23,16 +61,90 @@
 these may expose other cycles.

   $ hg locate 'mercurial/**.py' | xargs python "$import_checker"
+  mercurial/cmdutil.py mixed stdlib and relative imports:
+     errno, os, re, sys, tempfile
+  mercurial/commands.py mixed stdlib and relative imports:
+     difflib, errno, os, re, tempfile, time
+  mercurial/commandserver.py mixed stdlib and relative imports:
+     os, sys
+  mercurial/config.py mixed stdlib and relative imports:
+     errno, os
+  mercurial/context.py mixed stdlib and relative imports:
+     errno, os, stat
+  mercurial/dirstate.py mixed stdlib and relative imports:
+     errno, gc, os, stat
   mercurial/dispatch.py mixed stdlib and relative imports:
-     commands, error, extensions, fancyopts, hg, hook, util
-  mercurial/fileset.py mixed stdlib and relative imports:
-     error, merge, parser, util
-  mercurial/revset.py mixed stdlib and relative imports:
-     discovery, error, hbisect, parser, phases, util
+     atexit, errno, os, pdb, re, shlex, signal, socket, sys, time, traceback
+  mercurial/extensions.py mixed stdlib and relative imports:
+     imp, os
+  mercurial/help.py mixed stdlib and relative imports:
+     itertools, os, sys
+  mercurial/hg.py mixed stdlib and relative imports:
+     errno, os, shutil
+  mercurial/hgweb/common.py mixed stdlib and relative imports:
+     errno, mimetypes, os
+  mercurial/hgweb/request.py mixed stdlib and relative imports:
+     cgi, errno, socket
+  mercurial/hgweb/server.py mixed stdlib and relative imports:
+     BaseHTTPServer, SocketServer, errno, os, socket, sys, traceback, urllib
+  mercurial/hgweb/wsgicgi.py mixed stdlib and relative imports:
+     os, sys
+  mercurial/hook.py mixed stdlib and relative imports:
+     os, sys, time, types
+  mercurial/httppeer.py mixed stdlib and relative imports:
+     errno, socket
+  mercurial/i18n.py mixed stdlib and relative imports:
+     gettext, os, sys
+  mercurial/localrepo.py mixed stdlib and relative imports:
+     errno, inspect, os, time, weakref
+  mercurial/lock.py mixed stdlib and relative imports:
+     errno, os, socket, time
+  mercurial/mail.py mixed stdlib and relative imports:
+     os, quopri, smtplib, socket, sys, time
+  mercurial/merge.py mixed stdlib and relative imports:
+     errno, os, shutil
+  mercurial/patch.py mixed stdlib and relative imports:
+     cStringIO, email, errno, os, posixpath, re
+  mercurial/pathutil.py mixed stdlib and relative imports:
+     errno, os, stat
+  mercurial/posix.py mixed stdlib and relative imports:
+     errno, getpass, grp, os, pwd, socket, stat, sys, tempfile, unicodedata
+  mercurial/py3kcompat.py mixed stdlib and relative imports:
+     builtins, os
+  mercurial/revlog.py mixed stdlib and relative imports:
+     errno, struct, zlib
+  mercurial/scmposix.py mixed stdlib and relative imports:
+     os, sys
+  mercurial/scmutil.py mixed stdlib and relative imports:
+     errno, glob, os, re
+  mercurial/simplemerge.py mixed stdlib and relative imports:
+     os, sys
+  mercurial/sshserver.py mixed stdlib and relative imports:
+     os, sys
+  mercurial/statichttprepo.py mixed stdlib and relative imports:
+     errno, os, urllib, urllib2
+  mercurial/store.py mixed stdlib and relative imports:
+     errno, os, stat
+  mercurial/subrepo.py mixed stdlib and relative imports:
+     errno, os, posixpath, re, shutil, sys
   mercurial/templater.py mixed stdlib and relative imports:
-     config, error, parser, templatefilters, util
+     os, re, sys
   mercurial/ui.py mixed stdlib and relative imports:
-     config, error, formatter, scmutil, util
+     errno, getpass, os, socket, sys, tempfile, traceback
+  mercurial/util.py mixed stdlib and relative imports:
+     errno, re, shutil, sys, tempfile, traceback
+  mercurial/util.py mixed stdlib and relative imports:
+     calendar, collections, datetime, os, signal, textwrap, time
+  mercurial/util.py mixed stdlib and relative imports:
+     imp, socket, urllib
+  mercurial/win32.py mixed stdlib and relative imports:
+     ctypes, errno, os, random, subprocess
+  mercurial/windows.py mixed stdlib and relative imports:
+     _winreg, errno, msvcrt, os, re, stat, sys
+  mercurial/wireproto.py mixed stdlib and relative imports:
+     os, sys, tempfile, urllib
+  mercurial/worker.py mixed stdlib and relative imports:
+     errno, os, signal, sys, threading
   Import cycle: mercurial.cmdutil -> mercurial.subrepo -> mercurial.cmdutil
   Import cycle: mercurial.repoview -> mercurial.revset -> mercurial.repoview
   Import cycle: mercurial.fileset -> mercurial.merge -> mercurial.subrepo ->
mercurial.match -> mercurial.fileset

ERROR: .../mercurial/tests/test-module-imports.t output changed
!
Failed test-module-imports.t: output changed
# Ran 1 tests, 0 skipped, 1 failed.
python hash seed: 506701925

Patch

--- .../mercurial/tests/test-module-imports.t
+++ .../mercurial/tests/test-module-imports.t.err
@@ -8,6 +8,44 @@ 
   $ TERM=dumb
   $ export TERM
   $ python -m doctest $import_checker
+  **********************************************************************
+  File ".../mercurial/tests/../contrib/import-checker.py", line 21, in
import-checker.list_stdlib_modules
+  Failed example:
+      'BaseHTTPServer' in mods
+  Expected:
+      True
+  Got:
+      False
+  **********************************************************************
+  File ".../mercurial/tests/../contrib/import-checker.py", line 35, in
import-checker.list_stdlib_modules
+  Failed example:
+      'collections' in mods
+  Expected:
+      True
+  Got:
+      False
+  **********************************************************************
+  File ".../mercurial/tests/../contrib/import-checker.py", line 38, in
import-checker.list_stdlib_modules
+  Failed example:
+      'cStringIO' in mods
+  Expected:
+      True
+  Got:
+      False
+  **********************************************************************
+  File ".../mercurial/tests/../contrib/import-checker.py", line 117, in
import-checker.verify_stdlib_on_own_line
+  Failed example:
+      list(verify_stdlib_on_own_line('import sys, os'))
+  Expected:
+      []
+  Got:
+      ['mixed stdlib and relative imports:\n   os, sys']
+  **********************************************************************
+  2 items had failures:
+     3 of   6 in import-checker.list_stdlib_modules
+     1 of   3 in import-checker.verify_stdlib_on_own_line
+  ***Test Failed*** 4 failures.