Updated decorators test to use subTest().

This commit is contained in:
Chris Jerdonek 2018-04-16 12:47:06 -04:00 committed by Tim Graham
parent 93331877c8
commit 09f1f0387b
1 changed files with 9 additions and 9 deletions

View File

@ -244,13 +244,13 @@ class MethodDecoratorTests(SimpleTestCase):
"A method"
pass
for Test in (TestPlain, TestMethodAndClass, TestIterable):
tests = (TestPlain, TestMethodAndClass, TestIterable)
for Test in tests:
with self.subTest(Test=Test):
self.assertIs(getattr(Test().method, 'myattr', False), True)
self.assertIs(getattr(Test().method, 'myattr2', False), True)
self.assertIs(getattr(Test.method, 'myattr', False), True)
self.assertIs(getattr(Test.method, 'myattr2', False), True)
self.assertEqual(Test.method.__doc__, 'A method')
self.assertEqual(Test.method.__name__, 'method')