MCPcopy Index your code
hub / github.com/python/cpython / test_setup_module

Method test_setup_module

Lib/test/test_unittest/test_setups.py:265–283  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

263 'teardown 3', 'Module2.tearDownModule'])
264
265 def test_setup_module(self):
266 class Module(object):
267 moduleSetup = 0
268 @staticmethod
269 def setUpModule():
270 Module.moduleSetup += 1
271
272 class Test(unittest.TestCase):
273 def test_one(self):
274 pass
275 def test_two(self):
276 pass
277 Test.__module__ = 'Module'
278 sys.modules['Module'] = Module
279
280 result = self.runTests(Test)
281 self.assertEqual(Module.moduleSetup, 1)
282 self.assertEqual(result.testsRun, 2)
283 self.assertEqual(len(result.errors), 0)
284
285 def test_error_in_setup_module(self):
286 class Module(object):

Callers

nothing calls this directly

Calls 2

runTestsMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected