Anonymous avatar Anonymous committed 82582ae

put current pip on sys.path for tests; fixes #98; thanks Dave Abrahams

Comments (0)

Files changed (2)

tests/test_config.py

 from test_pip import here, reset_env, run_pip, clear_environ, write_file
 import os
 
-from pip.basecommand import open_logfile
-
 def test_options_from_env_vars():
     """
     Test if ConfigOptionParser reads env vars (e.g. not using PyPI here)
     Test opening a log file with no directory name.
     
     """
+    from pip.basecommand import open_logfile
     fp = open_logfile('testpip.log')
     fp.write('can write')
     fp.close()

tests/test_pip.py

 if 'PYTHONPATH' in os.environ:
     del os.environ['PYTHONPATH']
 
+# put this checkout of pip first on sys.path
+# necessary to support unit tests that don't use ScriptTest
+sys.path.insert(0, os.path.dirname(here))
+
 try:
     any
 except NameError:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.