mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Simplify testing the warning filename (GH-91868)
The context manager result has the "filename" attribute.
This commit is contained in:
parent
b4e048411f
commit
090721721b
8 changed files with 43 additions and 43 deletions
|
@ -2712,12 +2712,12 @@ class GetEventLoopTestsMixin:
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaises(TestError):
|
with self.assertRaises(TestError):
|
||||||
asyncio.get_event_loop()
|
asyncio.get_event_loop()
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
asyncio.set_event_loop(None)
|
asyncio.set_event_loop(None)
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaises(TestError):
|
with self.assertRaises(TestError):
|
||||||
asyncio.get_event_loop()
|
asyncio.get_event_loop()
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
|
|
||||||
with self.assertRaisesRegex(RuntimeError, 'no running'):
|
with self.assertRaisesRegex(RuntimeError, 'no running'):
|
||||||
asyncio.get_running_loop()
|
asyncio.get_running_loop()
|
||||||
|
@ -2734,13 +2734,13 @@ class GetEventLoopTestsMixin:
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaises(TestError):
|
with self.assertRaises(TestError):
|
||||||
asyncio.get_event_loop()
|
asyncio.get_event_loop()
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
|
|
||||||
asyncio.set_event_loop(None)
|
asyncio.set_event_loop(None)
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaises(TestError):
|
with self.assertRaises(TestError):
|
||||||
asyncio.get_event_loop()
|
asyncio.get_event_loop()
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
asyncio.set_event_loop_policy(old_policy)
|
asyncio.set_event_loop_policy(old_policy)
|
||||||
|
@ -2762,12 +2762,12 @@ class GetEventLoopTestsMixin:
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
loop2 = asyncio.get_event_loop()
|
loop2 = asyncio.get_event_loop()
|
||||||
self.addCleanup(loop2.close)
|
self.addCleanup(loop2.close)
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
asyncio.set_event_loop(None)
|
asyncio.set_event_loop(None)
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaisesRegex(RuntimeError, 'no current'):
|
with self.assertRaisesRegex(RuntimeError, 'no current'):
|
||||||
asyncio.get_event_loop()
|
asyncio.get_event_loop()
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
|
|
||||||
with self.assertRaisesRegex(RuntimeError, 'no running'):
|
with self.assertRaisesRegex(RuntimeError, 'no running'):
|
||||||
asyncio.get_running_loop()
|
asyncio.get_running_loop()
|
||||||
|
@ -2783,13 +2783,13 @@ class GetEventLoopTestsMixin:
|
||||||
asyncio.set_event_loop(loop)
|
asyncio.set_event_loop(loop)
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
self.assertIs(asyncio.get_event_loop(), loop)
|
self.assertIs(asyncio.get_event_loop(), loop)
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
|
|
||||||
asyncio.set_event_loop(None)
|
asyncio.set_event_loop(None)
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaisesRegex(RuntimeError, 'no current'):
|
with self.assertRaisesRegex(RuntimeError, 'no current'):
|
||||||
asyncio.get_event_loop()
|
asyncio.get_event_loop()
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
asyncio.set_event_loop_policy(old_policy)
|
asyncio.set_event_loop_policy(old_policy)
|
||||||
|
|
|
@ -148,7 +148,7 @@ class BaseFutureTests:
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
|
with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
|
||||||
self._new_future()
|
self._new_future()
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
|
|
||||||
def test_constructor_use_running_loop(self):
|
def test_constructor_use_running_loop(self):
|
||||||
async def test():
|
async def test():
|
||||||
|
@ -163,7 +163,7 @@ class BaseFutureTests:
|
||||||
self.addCleanup(asyncio.set_event_loop, None)
|
self.addCleanup(asyncio.set_event_loop, None)
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
f = self._new_future()
|
f = self._new_future()
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
self.assertIs(f._loop, self.loop)
|
self.assertIs(f._loop, self.loop)
|
||||||
self.assertIs(f.get_loop(), self.loop)
|
self.assertIs(f.get_loop(), self.loop)
|
||||||
|
|
||||||
|
@ -510,7 +510,7 @@ class BaseFutureTests:
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaises(RuntimeError):
|
with self.assertRaises(RuntimeError):
|
||||||
asyncio.wrap_future(f1)
|
asyncio.wrap_future(f1)
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
ex.shutdown(wait=True)
|
ex.shutdown(wait=True)
|
||||||
|
|
||||||
def test_wrap_future_use_running_loop(self):
|
def test_wrap_future_use_running_loop(self):
|
||||||
|
@ -534,7 +534,7 @@ class BaseFutureTests:
|
||||||
f1 = ex.submit(run, 'oi')
|
f1 = ex.submit(run, 'oi')
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
f2 = asyncio.wrap_future(f1)
|
f2 = asyncio.wrap_future(f1)
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
self.assertIs(self.loop, f2._loop)
|
self.assertIs(self.loop, f2._loop)
|
||||||
ex.shutdown(wait=True)
|
ex.shutdown(wait=True)
|
||||||
|
|
||||||
|
|
|
@ -813,7 +813,7 @@ os.close(fd)
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
|
with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
|
||||||
asyncio.StreamReader()
|
asyncio.StreamReader()
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
|
|
||||||
def test_streamreader_constructor_use_running_loop(self):
|
def test_streamreader_constructor_use_running_loop(self):
|
||||||
# asyncio issue #184: Ensure that StreamReaderProtocol constructor
|
# asyncio issue #184: Ensure that StreamReaderProtocol constructor
|
||||||
|
@ -832,7 +832,7 @@ os.close(fd)
|
||||||
asyncio.set_event_loop(self.loop)
|
asyncio.set_event_loop(self.loop)
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
reader = asyncio.StreamReader()
|
reader = asyncio.StreamReader()
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
self.assertIs(reader._loop, self.loop)
|
self.assertIs(reader._loop, self.loop)
|
||||||
|
|
||||||
|
|
||||||
|
@ -841,7 +841,7 @@ os.close(fd)
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
|
with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
|
||||||
asyncio.StreamReaderProtocol(reader)
|
asyncio.StreamReaderProtocol(reader)
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
|
|
||||||
def test_streamreaderprotocol_constructor_use_running_loop(self):
|
def test_streamreaderprotocol_constructor_use_running_loop(self):
|
||||||
# asyncio issue #184: Ensure that StreamReaderProtocol constructor
|
# asyncio issue #184: Ensure that StreamReaderProtocol constructor
|
||||||
|
@ -861,7 +861,7 @@ os.close(fd)
|
||||||
reader = mock.Mock()
|
reader = mock.Mock()
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
protocol = asyncio.StreamReaderProtocol(reader)
|
protocol = asyncio.StreamReaderProtocol(reader)
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
self.assertIs(protocol._loop, self.loop)
|
self.assertIs(protocol._loop, self.loop)
|
||||||
|
|
||||||
def test_drain_raises(self):
|
def test_drain_raises(self):
|
||||||
|
|
|
@ -211,7 +211,7 @@ class BaseTaskTests:
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
|
with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
|
||||||
asyncio.ensure_future(a)
|
asyncio.ensure_future(a)
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
|
|
||||||
async def test():
|
async def test():
|
||||||
return asyncio.ensure_future(notmuch())
|
return asyncio.ensure_future(notmuch())
|
||||||
|
@ -226,7 +226,7 @@ class BaseTaskTests:
|
||||||
self.addCleanup(asyncio.set_event_loop, None)
|
self.addCleanup(asyncio.set_event_loop, None)
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
t = asyncio.ensure_future(notmuch())
|
t = asyncio.ensure_future(notmuch())
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
self.assertIs(t._loop, self.loop)
|
self.assertIs(t._loop, self.loop)
|
||||||
self.loop.run_until_complete(t)
|
self.loop.run_until_complete(t)
|
||||||
self.assertTrue(t.done())
|
self.assertTrue(t.done())
|
||||||
|
@ -1449,7 +1449,7 @@ class BaseTaskTests:
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
|
with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
|
||||||
list(futs)
|
list(futs)
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
|
|
||||||
def test_as_completed_coroutine_use_running_loop(self):
|
def test_as_completed_coroutine_use_running_loop(self):
|
||||||
loop = self.new_test_loop()
|
loop = self.new_test_loop()
|
||||||
|
@ -1881,7 +1881,7 @@ class BaseTaskTests:
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
|
with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
|
||||||
asyncio.shield(inner)
|
asyncio.shield(inner)
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
|
|
||||||
def test_shield_coroutine_use_running_loop(self):
|
def test_shield_coroutine_use_running_loop(self):
|
||||||
async def coro():
|
async def coro():
|
||||||
|
@ -1903,7 +1903,7 @@ class BaseTaskTests:
|
||||||
self.addCleanup(asyncio.set_event_loop, None)
|
self.addCleanup(asyncio.set_event_loop, None)
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
outer = asyncio.shield(coro())
|
outer = asyncio.shield(coro())
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
self.assertEqual(outer._loop, self.loop)
|
self.assertEqual(outer._loop, self.loop)
|
||||||
res = self.loop.run_until_complete(outer)
|
res = self.loop.run_until_complete(outer)
|
||||||
self.assertEqual(res, 42)
|
self.assertEqual(res, 42)
|
||||||
|
@ -2911,7 +2911,7 @@ class FutureGatherTests(GatherTestsBase, test_utils.TestCase):
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaises(RuntimeError):
|
with self.assertRaises(RuntimeError):
|
||||||
asyncio.gather()
|
asyncio.gather()
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
|
|
||||||
def test_constructor_empty_sequence_use_running_loop(self):
|
def test_constructor_empty_sequence_use_running_loop(self):
|
||||||
async def gather():
|
async def gather():
|
||||||
|
@ -2929,7 +2929,7 @@ class FutureGatherTests(GatherTestsBase, test_utils.TestCase):
|
||||||
self.addCleanup(asyncio.set_event_loop, None)
|
self.addCleanup(asyncio.set_event_loop, None)
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
fut = asyncio.gather()
|
fut = asyncio.gather()
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
self.assertIsInstance(fut, asyncio.Future)
|
self.assertIsInstance(fut, asyncio.Future)
|
||||||
self.assertIs(fut._loop, self.one_loop)
|
self.assertIs(fut._loop, self.one_loop)
|
||||||
self._run_loop(self.one_loop)
|
self._run_loop(self.one_loop)
|
||||||
|
@ -3020,7 +3020,7 @@ class CoroutineGatherTests(GatherTestsBase, test_utils.TestCase):
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
with self.assertRaises(RuntimeError):
|
with self.assertRaises(RuntimeError):
|
||||||
asyncio.gather(gen1, gen2)
|
asyncio.gather(gen1, gen2)
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
|
|
||||||
def test_constructor_use_running_loop(self):
|
def test_constructor_use_running_loop(self):
|
||||||
async def coro():
|
async def coro():
|
||||||
|
@ -3043,7 +3043,7 @@ class CoroutineGatherTests(GatherTestsBase, test_utils.TestCase):
|
||||||
gen2 = coro()
|
gen2 = coro()
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
fut = asyncio.gather(gen1, gen2)
|
fut = asyncio.gather(gen1, gen2)
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(cm.filename, __file__)
|
||||||
self.assertIs(fut._loop, self.other_loop)
|
self.assertIs(fut._loop, self.other_loop)
|
||||||
self.other_loop.run_until_complete(fut)
|
self.other_loop.run_until_complete(fut)
|
||||||
|
|
||||||
|
|
|
@ -2608,11 +2608,11 @@ class ImplementationTest(unittest.TestCase):
|
||||||
for name in deprecated:
|
for name in deprecated:
|
||||||
with self.subTest(module=name):
|
with self.subTest(module=name):
|
||||||
sys.modules.pop(name, None)
|
sys.modules.pop(name, None)
|
||||||
with self.assertWarns(DeprecationWarning) as cm:
|
with self.assertWarns(DeprecationWarning) as w:
|
||||||
__import__(name)
|
__import__(name)
|
||||||
self.assertEqual(str(cm.warnings[0].message),
|
self.assertEqual(str(w.warning),
|
||||||
f"module {name!r} is deprecated")
|
f"module {name!r} is deprecated")
|
||||||
self.assertEqual(cm.warnings[0].filename, __file__)
|
self.assertEqual(w.filename, __file__)
|
||||||
self.assertIn(name, sys.modules)
|
self.assertIn(name, sys.modules)
|
||||||
mod = sys.modules[name]
|
mod = sys.modules[name]
|
||||||
self.assertEqual(mod.__name__, name)
|
self.assertEqual(mod.__name__, name)
|
||||||
|
|
|
@ -259,15 +259,15 @@ class TestAsyncCase(unittest.TestCase):
|
||||||
|
|
||||||
with self.assertWarns(DeprecationWarning) as w:
|
with self.assertWarns(DeprecationWarning) as w:
|
||||||
Test('test1').run()
|
Test('test1').run()
|
||||||
self.assertIn('It is deprecated to return a value!=None', str(w.warnings[0].message))
|
self.assertIn('It is deprecated to return a value!=None', str(w.warning))
|
||||||
self.assertIn('test1', str(w.warnings[0].message))
|
self.assertIn('test1', str(w.warning))
|
||||||
self.assertEqual(w.warnings[0].filename, __file__)
|
self.assertEqual(w.filename, __file__)
|
||||||
|
|
||||||
with self.assertWarns(DeprecationWarning) as w:
|
with self.assertWarns(DeprecationWarning) as w:
|
||||||
Test('test2').run()
|
Test('test2').run()
|
||||||
self.assertIn('It is deprecated to return a value!=None', str(w.warnings[0].message))
|
self.assertIn('It is deprecated to return a value!=None', str(w.warning))
|
||||||
self.assertIn('test2', str(w.warnings[0].message))
|
self.assertIn('test2', str(w.warning))
|
||||||
self.assertEqual(w.warnings[0].filename, __file__)
|
self.assertEqual(w.filename, __file__)
|
||||||
|
|
||||||
def test_cleanups_interleave_order(self):
|
def test_cleanups_interleave_order(self):
|
||||||
events = []
|
events = []
|
||||||
|
|
|
@ -316,15 +316,15 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
|
||||||
|
|
||||||
with self.assertWarns(DeprecationWarning) as w:
|
with self.assertWarns(DeprecationWarning) as w:
|
||||||
Foo('test1').run()
|
Foo('test1').run()
|
||||||
self.assertIn('It is deprecated to return a value!=None', str(w.warnings[0].message))
|
self.assertIn('It is deprecated to return a value!=None', str(w.warning))
|
||||||
self.assertIn('test1', str(w.warnings[0].message))
|
self.assertIn('test1', str(w.warning))
|
||||||
self.assertEqual(w.warnings[0].filename, __file__)
|
self.assertEqual(w.filename, __file__)
|
||||||
|
|
||||||
with self.assertWarns(DeprecationWarning) as w:
|
with self.assertWarns(DeprecationWarning) as w:
|
||||||
Foo('test2').run()
|
Foo('test2').run()
|
||||||
self.assertIn('It is deprecated to return a value!=None', str(w.warnings[0].message))
|
self.assertIn('It is deprecated to return a value!=None', str(w.warning))
|
||||||
self.assertIn('test2', str(w.warnings[0].message))
|
self.assertIn('test2', str(w.warning))
|
||||||
self.assertEqual(w.warnings[0].filename, __file__)
|
self.assertEqual(w.filename, __file__)
|
||||||
|
|
||||||
def _check_call_order__subtests(self, result, events, expected_events):
|
def _check_call_order__subtests(self, result, events, expected_events):
|
||||||
class Foo(Test.LoggingTestCase):
|
class Foo(Test.LoggingTestCase):
|
||||||
|
|
|
@ -1609,7 +1609,7 @@ class TestObsoleteFunctions(unittest.TestCase):
|
||||||
tests = unittest.getTestCaseNames(self.MyTestCase,
|
tests = unittest.getTestCaseNames(self.MyTestCase,
|
||||||
prefix='check', sortUsing=self.reverse_three_way_cmp,
|
prefix='check', sortUsing=self.reverse_three_way_cmp,
|
||||||
testNamePatterns=None)
|
testNamePatterns=None)
|
||||||
self.assertEqual(w.warnings[0].filename, __file__)
|
self.assertEqual(w.filename, __file__)
|
||||||
self.assertEqual(tests, ['check_2', 'check_1'])
|
self.assertEqual(tests, ['check_2', 'check_1'])
|
||||||
|
|
||||||
def test_makeSuite(self):
|
def test_makeSuite(self):
|
||||||
|
@ -1617,7 +1617,7 @@ class TestObsoleteFunctions(unittest.TestCase):
|
||||||
suite = unittest.makeSuite(self.MyTestCase,
|
suite = unittest.makeSuite(self.MyTestCase,
|
||||||
prefix='check', sortUsing=self.reverse_three_way_cmp,
|
prefix='check', sortUsing=self.reverse_three_way_cmp,
|
||||||
suiteClass=self.MyTestSuite)
|
suiteClass=self.MyTestSuite)
|
||||||
self.assertEqual(w.warnings[0].filename, __file__)
|
self.assertEqual(w.filename, __file__)
|
||||||
self.assertIsInstance(suite, self.MyTestSuite)
|
self.assertIsInstance(suite, self.MyTestSuite)
|
||||||
expected = self.MyTestSuite([self.MyTestCase('check_2'),
|
expected = self.MyTestSuite([self.MyTestCase('check_2'),
|
||||||
self.MyTestCase('check_1')])
|
self.MyTestCase('check_1')])
|
||||||
|
@ -1631,7 +1631,7 @@ class TestObsoleteFunctions(unittest.TestCase):
|
||||||
suite = unittest.findTestCases(m,
|
suite = unittest.findTestCases(m,
|
||||||
prefix='check', sortUsing=self.reverse_three_way_cmp,
|
prefix='check', sortUsing=self.reverse_three_way_cmp,
|
||||||
suiteClass=self.MyTestSuite)
|
suiteClass=self.MyTestSuite)
|
||||||
self.assertEqual(w.warnings[0].filename, __file__)
|
self.assertEqual(w.filename, __file__)
|
||||||
self.assertIsInstance(suite, self.MyTestSuite)
|
self.assertIsInstance(suite, self.MyTestSuite)
|
||||||
expected = [self.MyTestSuite([self.MyTestCase('check_2'),
|
expected = [self.MyTestSuite([self.MyTestCase('check_2'),
|
||||||
self.MyTestCase('check_1')])]
|
self.MyTestCase('check_1')])]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue