mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-71339: Fix an order-dependent failure in test_unittest (GH-129133)
It failed if it was preceded by test_builtin.
This commit is contained in:
parent
5809b25909
commit
4b37a6bda2
2 changed files with 6 additions and 3 deletions
|
@ -1833,7 +1833,10 @@ class BuiltinTest(ComplexesAreIdenticalMixin, unittest.TestCase):
|
|||
|
||||
def test_setattr(self):
|
||||
setattr(sys, 'spam', 1)
|
||||
self.assertEqual(sys.spam, 1)
|
||||
try:
|
||||
self.assertEqual(sys.spam, 1)
|
||||
finally:
|
||||
del sys.spam
|
||||
self.assertRaises(TypeError, setattr)
|
||||
self.assertRaises(TypeError, setattr, sys)
|
||||
self.assertRaises(TypeError, setattr, sys, 'spam')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue