D4910: tests: do not change sys.path, it can break loading cext.parsers

joerg.sonnenberger (Joerg Sonnenberger) phabricator at mercurial-scm.org
Mon Oct 8 19:53:43 UTC 2018


joerg.sonnenberger created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  When running this tests with run-tests, the prefix would resolve
  mercurial.cext to the source tree and the attempt to load
  mercurial.cext.parsers would therefore fail since it doesn't exist in
  it. With the regular search path from run-tests, it is picked up from
  the temporary prefix correctly.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4910

AFFECTED FILES
  tests/test-lfs-pointer.py
  tests/test-minifileset.py

CHANGE DETAILS

diff --git a/tests/test-minifileset.py b/tests/test-minifileset.py
--- a/tests/test-minifileset.py
+++ b/tests/test-minifileset.py
@@ -4,9 +4,6 @@
 import os
 import sys
 
-# make it runnable directly without run-tests.py
-sys.path[0:0] = [os.path.join(os.path.dirname(__file__), '..')]
-
 from mercurial import minifileset
 
 def check(text, truecases, falsecases):
diff --git a/tests/test-lfs-pointer.py b/tests/test-lfs-pointer.py
--- a/tests/test-lfs-pointer.py
+++ b/tests/test-lfs-pointer.py
@@ -3,9 +3,6 @@
 import os
 import sys
 
-# make it runnable using python directly without run-tests.py
-sys.path[0:0] = [os.path.join(os.path.dirname(__file__), '..')]
-
 # Import something from Mercurial, so the module loader gets initialized.
 from mercurial import pycompat
 del pycompat  # unused for now



To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list