[Bug 4706] New: Tests test-doctest.py does not run against the local mercurial but the system mercurial

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Wed Jun 3 18:48:04 UTC 2015


http://bz.selenic.com/show_bug.cgi?id=4706

          Priority: normal
            Bug ID: 4706
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: Tests test-doctest.py does not run against the local
                    mercurial but the system mercurial
          Severity: bug
    Classification: Unclassified
                OS: Mac OS
          Reporter: lcharignon at fb.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 3.4-rc
         Component: Mercurial
           Product: Mercurial

This is most certainly a configuration issue.
I have both a local checkout of the mercurial repo from where I run the tests
and a system-wide install of mercurial

I wrote a failing doctest and saw that it was not showing as a failure running:

$ python run-tests.py test-doctest.py -l
.                                                                               
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.

I changed the line __import__(name) to print __import__(name) to check what was
being imported suspecting that the wrong mercurial was imported:

--- /Users/lcharignon/devbench/tests/test-doctest.py.out
+++ /Users/lcharignon/devbench/tests/test-doctest.py.err
@@ -0,0 +1,23 @@
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'mercurial' from
'/Library/Python/2.7/site-packages/mercurial/__init__.pyc'>
+<module 'hgext' from '/Library/Python/2.7/site-packages/hgext/__init__.pyc'>
+<module 'hgext' from '/Library/Python/2.7/site-packages/hgext/__init__.pyc'>
+<module 'hgext' from '/Library/Python/2.7/site-packages/hgext/__init__.pyc'>
+<module 'hgext' from '/Library/Python/2.7/site-packages/hgext/__init__.pyc'>

ERROR: test-doctest.py output changed
!
Failed test-doctest.py: output changed
# Ran 1 tests, 0 skipped, 0 warned, 1 failed.
python hash seed: 3697258906

I tried to run the command with an empty PYTHONPATH and got the same result.
As a workaround I added 'sys.path.insert(1,"..")' before the import:
 - running the test with run-tests.py didn't work, still importing the system
mercurial
 - running the test directly with python test-doctest.py -v worked

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list