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

login
register
mail settings
Submitter mercurial-bugs@selenic.com
Date June 3, 2015, 6:48 p.m.
Message ID <bug-4706-285@http.bz.selenic.com/>
Download mbox | patch
Permalink /patch/9455/
State Not Applicable
Headers show

Comments

mercurial-bugs@selenic.com - June 3, 2015, 6:48 p.m.
http://bz.selenic.com/show_bug.cgi?id=4706

          Priority: normal
            Bug ID: 4706
                CC: mercurial-devel@selenic.com
          Assignee: bugzilla@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@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:

'/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

Patch

--- /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