bpo-44761: Change default value of NewType __module__ attr (GH-27406)

This commit is contained in:
Yurii Karabas 2021-07-30 15:56:12 +03:00 committed by GitHub
parent 6ff8903809
commit 7b975f81e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View file

@ -3777,6 +3777,12 @@ def test_pickle(self):
with self.assertRaises(pickle.PicklingError):
pickle.dumps(UserAge, proto)
def test_missing__name__(self):
code = ("import typing\n"
"NT = typing.NewType('NT', int)\n"
)
exec(code, {})
class NewTypePythonTests(NewTypeTests, BaseTestCase):
module = py_typing