summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_set.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2021-12-26 11:27:01 (GMT)
committerGitHub <noreply@github.com>2021-12-26 11:27:01 (GMT)
commitad4857884b4821fc2c9bd23b63d03f9570eb03d1 (patch)
treefdbc54ffa82549de72904e5b474e02ecf2616a69 /Lib/test/test_set.py
parent1944434b44e0118e812bf63f47b268ff6dd0c8f1 (diff)
downloadcpython-ad4857884b4821fc2c9bd23b63d03f9570eb03d1.zip
cpython-ad4857884b4821fc2c9bd23b63d03f9570eb03d1.tar.gz
cpython-ad4857884b4821fc2c9bd23b63d03f9570eb03d1.tar.bz2
bpo-43413: Revert changes in set.__init__ (GH-28403)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Diffstat (limited to 'Lib/test/test_set.py')
-rw-r--r--Lib/test/test_set.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 65fda9e..77f3da4 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -667,10 +667,13 @@ class TestSetSubclass(TestSet):
self = super().__new__(cls, arg)
self.newarg = newarg
return self
- u = subclass_with_new([1, 2], newarg=3)
+ u = subclass_with_new([1, 2])
self.assertIs(type(u), subclass_with_new)
self.assertEqual(set(u), {1, 2})
- self.assertEqual(u.newarg, 3)
+ self.assertIsNone(u.newarg)
+ # disallow kwargs in __new__ only (https://bugs.python.org/issue43413#msg402000)
+ with self.assertRaises(TypeError):
+ subclass_with_new([1, 2], newarg=3)
class TestFrozenSet(TestJointOps, unittest.TestCase):