Merge pull request #2657 from nschlemm/20140516-test_testcase_ordering
cater for running tests from another directory than tests
This commit is contained in:
commit
4a98130735
|
@ -104,17 +104,18 @@ class DiscoverRunnerTest(TestCase):
|
||||||
self.assertEqual(count, 0)
|
self.assertEqual(count, 0)
|
||||||
|
|
||||||
def test_testcase_ordering(self):
|
def test_testcase_ordering(self):
|
||||||
suite = DiscoverRunner().build_suite(["test_discovery_sample/"])
|
with change_cwd(".."):
|
||||||
self.assertEqual(
|
suite = DiscoverRunner().build_suite(["test_discovery_sample/"])
|
||||||
suite._tests[0].__class__.__name__,
|
self.assertEqual(
|
||||||
'TestDjangoTestCase',
|
suite._tests[0].__class__.__name__,
|
||||||
msg="TestDjangoTestCase should be the first test case")
|
'TestDjangoTestCase',
|
||||||
self.assertEqual(
|
msg="TestDjangoTestCase should be the first test case")
|
||||||
suite._tests[1].__class__.__name__,
|
self.assertEqual(
|
||||||
'TestZimpleTestCase',
|
suite._tests[1].__class__.__name__,
|
||||||
msg="TestZimpleTestCase should be the second test case")
|
'TestZimpleTestCase',
|
||||||
# All others can follow in unspecified order, including doctests
|
msg="TestZimpleTestCase should be the second test case")
|
||||||
self.assertIn('DocTestCase', [t.__class__.__name__ for t in suite._tests[2:]])
|
# 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):
|
def test_overrideable_test_suite(self):
|
||||||
self.assertEqual(DiscoverRunner().test_suite, TestSuite)
|
self.assertEqual(DiscoverRunner().test_suite, TestSuite)
|
||||||
|
|
Loading…
Reference in New Issue