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 | 59ed861fd72f1577e696616796155cbb665e5f75 (patch) | |
tree | dad6aa1b015f1a68dd359ee278cb23635804420a | |
parent | dac067e97e6466254fa1d31ac3adef9b746f6455 (diff) | |
download | python-coveragepy-59ed861fd72f1577e696616796155cbb665e5f75.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 5613fa6..4cc777d 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 |