Commits

Ian Bicking committed 2e1e524 Merge
  • Participants
  • Parent commits 9a62890, 867268d

Comments (0)

Files changed (4)

File docs/news.txt

 News for pip
 ============
 
+tip
+---
+
+* Fixed opening of logfile with no directory name. Thanks Alexandre Conrad.
+
 0.7
 ---
 
 mkdir -p docs/_static docs/_build
 sphinx-build -E -b html docs/ docs/_build || exit 1
 if [ "$CMD" = "publish" ] ; then
-  cd docs/_build
+  cd docs/
   echo "Uploading files..."
-  tar czvf - . | ssh flow.openplans.org 'ssh acura.openplans.org "cd /www/pip.openplans.org/htdocs/; tar xzvf -"'
+  scp -r _build/ root@cloudsilverlining.org:/var/lib/silverlining/writable-roots/bbdocs/pip.openplans.org/
+  ssh root@cloudsilverlining.org 'chown -R www-data:www-data /var/lib/silverlining/writable-roots/bbdocs/'
 fi

File 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)
     assert "Getting page http://pypi.appspot.com/INITools" not in result.stdout
     assert "Getting page http://pypi.python.org/simple/INITools" in result.stdout
 
+def test_log_file_no_directory():
+    """
+    Test opening a log file with no directory name.
+    
+    """
+    fp = open_logfile('testpip.log')
+    fp.write('can write')
+    fp.close()
+    assert os.path.exists(fp.name)
+    os.remove(fp.name)

File tests/test_pip.py

         environ['PIP_DOWNLOAD_CACHE'] = download_cache
     environ['PIP_NO_INPUT'] = '1'
     environ['PIP_LOG_FILE'] = os.path.join(base_path, 'pip-log.txt')
+    # put the test-scratch virtualenv's bin dir first on the script path
+    environ['PATH'] = "%s%s%s" % (virtualenv_bin_dir(base_path), os.pathsep, environ['PATH'])
 
-    env = TestFileEnvironment(base_path, ignore_hidden=False, environ=environ)
+    env = TestFileEnvironment(base_path, ignore_hidden=False, environ=environ,
+                              capture_temp=True, assert_no_temp=True)
     env.run(sys.executable, '-m', 'virtualenv', '--no-site-packages', env.base_path)
 
-    # put the test-scratch virtualenv's bin dir first on the script path
-    env.script_path.insert(0, virtualenv_bin_dir(env.base_path))
-    
+    # test that test-scratch virtualenv creation produced sensible venv python
+    result = env.run('python', '-c', 'import sys; print sys.executable')
+    pythonbin = result.stdout.strip()
+    if pythonbin != os.path.join(virtualenv_bin_dir(env.base_path), "python"):
+        raise RuntimeError("Python sys.executable (%r) isn't the "
+                           "test-scratch venv python" % pythonbin)
+
     # make sure we have current setuptools to avoid svn incompatibilities
     env.run('easy_install', 'setuptools==0.6c11')
 
 
     Ignores mtime and other file attributes; only presence/absence and
     size are considered.
-    
+
     """
     ignore = ignore or []
     start_keys = set([k for k in start.keys()
 if __name__ == '__main__':
     sys.stderr.write("Run pip's tests using nosetests. Requires virtualenv, ScriptTest, and nose.\n")
     sys.exit(1)
-