diff options
| author | Konrad Delong <konryd@gmail.com> | 2010-07-27 14:59:11 +0200 |
|---|---|---|
| committer | Konrad Delong <konryd@gmail.com> | 2010-07-27 14:59:11 +0200 |
| commit | 462f1aa669f88e31a24fbb67329718e267cb7672 (patch) | |
| tree | b256f4e250f1ae18c8072a93120fd6521ebaca8b /src/distutils2 | |
| parent | 45ea8b9ac0acf1bab63df62120314fb918f9c37e (diff) | |
| download | disutils2-462f1aa669f88e31a24fbb67329718e267cb7672.tar.gz | |
fdrake's suggested improvements implemented
Diffstat (limited to 'src/distutils2')
| -rw-r--r-- | src/distutils2/tests/test_test.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/distutils2/tests/test_test.py b/src/distutils2/tests/test_test.py index e91dd4b..7159af6 100644 --- a/src/distutils2/tests/test_test.py +++ b/src/distutils2/tests/test_test.py @@ -11,28 +11,29 @@ try: except NameError: from distutils2._backport import any -EXPECTED_OUTPUT_RE = '''\ -FAIL: test_blah \\(myowntestmodule.SomeTest\\) +EXPECTED_OUTPUT_RE = r'''FAIL: test_blah \(myowntestmodule.SomeTest\) ---------------------------------------------------------------------- -Traceback \\(most recent call last\\): - File ".+/myowntestmodule.py", line \\d+, in test_blah - self.fail\\("horribly"\\) +Traceback \(most recent call last\): + File ".+/myowntestmodule.py", line \d+, in test_blah + self.fail\("horribly"\) AssertionError: horribly ''' +here = os.path.dirname(os.path.abspath(__file__)) + + class TestTest(TempdirManager, unittest.TestCase): def setUp(self): super(TestTest, self).setUp() - distutils2path = join(__file__, '..', '..', '..') - distutils2path = os.path.abspath(distutils2path) + distutils2path = os.path.dirname(os.path.dirname(here)) self.old_pythonpath = os.environ.get('PYTHONPATH', '') - os.environ['PYTHONPATH'] = distutils2path + ":" + self.old_pythonpath + os.environ['PYTHONPATH'] = distutils2path + os.pathsep + self.old_pythonpath def tearDown(self): - super(TestTest, self).tearDown() os.environ['PYTHONPATH'] = self.old_pythonpath + super(TestTest, self).tearDown() def assert_re_match(self, pattern, string): def quote(s): @@ -86,5 +87,4 @@ class TestTest(TempdirManager, unittest.TestCase): pass def test_suite(): - suite = [unittest.makeSuite(TestTest)] - return unittest.TestSuite(suite) + return unittest.makeSuite(TestTest) |
