]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-48330: assert warning is emitted on unittest.TestResult with no addDuration (...
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Thu, 6 Apr 2023 13:05:23 +0000 (14:05 +0100)
committerGitHub <noreply@github.com>
Thu, 6 Apr 2023 13:05:23 +0000 (14:05 +0100)
Lib/test/test_unittest/test_case.py

index 05d60a8ad3cf948965306a7c8470a47a18052ab3..dd5ff6d553e61deb441e8e3aff63258da0c4cb86 100644 (file)
@@ -304,7 +304,8 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
             def test(self):
                 pass
 
-        Foo('test').run()
+        with self.assertWarns(RuntimeWarning):
+            Foo('test').run()
 
     def test_deprecation_of_return_val_from_test(self):
         # Issue 41322 - deprecate return of value that is not None from a test