diff options
| author | Nikolaus Schlemm <capo@coder-nostra.com> | 2014-05-16 12:11:35 +0200 |
|---|---|---|
| committer | Nikolaus Schlemm <capo@coder-nostra.com> | 2014-05-16 12:11:35 +0200 |
| commit | d11e83620380fdd98679b09062eefd25f0a98e21 (patch) | |
| tree | 473fd9f0da163c79887fe56c58e44e1e68bc48c4 | |
| parent | e520a73eeea6b185b719901ab9985ecef00e5664 (diff) | |
cater for running tests from another directory than tests - applying existing pattern to newly added test_testcase_ordering as well
| -rw-r--r-- | tests/test_runner/test_discover_runner.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/tests/test_runner/test_discover_runner.py b/tests/test_runner/test_discover_runner.py index 975819508d..4ab0cf8ae3 100644 --- a/tests/test_runner/test_discover_runner.py +++ b/tests/test_runner/test_discover_runner.py @@ -104,17 +104,18 @@ class DiscoverRunnerTest(TestCase): self.assertEqual(count, 0) def test_testcase_ordering(self): - suite = DiscoverRunner().build_suite(["test_discovery_sample/"]) - self.assertEqual( - suite._tests[0].__class__.__name__, - 'TestDjangoTestCase', - msg="TestDjangoTestCase should be the first test case") - self.assertEqual( - suite._tests[1].__class__.__name__, - 'TestZimpleTestCase', - msg="TestZimpleTestCase should be the second test case") - # All others can follow in unspecified order, including doctests - self.assertIn('DocTestCase', [t.__class__.__name__ for t in suite._tests[2:]]) + with change_cwd(".."): + suite = DiscoverRunner().build_suite(["test_discovery_sample/"]) + self.assertEqual( + suite._tests[0].__class__.__name__, + 'TestDjangoTestCase', + msg="TestDjangoTestCase should be the first test case") + self.assertEqual( + suite._tests[1].__class__.__name__, + 'TestZimpleTestCase', + msg="TestZimpleTestCase should be the second test case") + # All others can follow in unspecified order, including doctests + self.assertIn('DocTestCase', [t.__class__.__name__ for t in suite._tests[2:]]) def test_overrideable_test_suite(self): self.assertEqual(DiscoverRunner().test_suite, TestSuite) |
