From cf4bd881d9cb49a36cd51cda37e1244add23bb14 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Sep 2013 11:51:05 -0400 Subject: 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! --- tests/coveragetest.py | 7 +++++-- 1 file 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 -- cgit v1.2.1