diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-09-15 11:51:05 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-09-15 11:51:05 -0400 |
commit | cf4bd881d9cb49a36cd51cda37e1244add23bb14 (patch) | |
tree | bfc1148237347ae36693947e183c254bb41d9732 | |
parent | 9748351b6872715188c4d884fd0bdd58bcadb5b6 (diff) | |
download | python-coveragepy-git-cf4bd881d9cb49a36cd51cda37e1244add23bb14.tar.gz |
Make our sys.path adjustment more robust.
Nose uses a custom importer that seems to cache. Using "" for the current
directory gets it confused for some reason, but only on a Mac, using Py3.3,
in a virtualenv!
-rw-r--r-- | tests/coveragetest.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/coveragetest.py b/tests/coveragetest.py index 5613fa69..4cc777d8 100644 --- a/tests/coveragetest.py +++ b/tests/coveragetest.py @@ -61,8 +61,11 @@ class CoverageTest(TestCase): self.old_dir = os.getcwd() os.chdir(self.temp_dir) - # Modules should be importable from this temp directory. - sys.path.insert(0, '') + # Modules should be importable from this temp directory. We don't + # use '' because we make lots of different temp directories and + # nose's caching importer can get confused. The full path prevents + # problems. + sys.path.insert(0, os.getcwd()) # Keep a counter to make every call to check_coverage unique. self.n = 0 |