Visitar URL original
gh-118895: Call PyType_Ready() on typing.NoDefault by JelleZijlstra · Pull Request #118897 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Feedback
  • Loading branch information
JelleZijlstra committed May 10, 2024
commit 5695c229a895c298d08e9fd4d01ecfc5075feb42
5 changes: 4 additions & 1 deletion Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import weakref
import types

from test.support import captured_stderr, cpython_only, infinite_recursion
from test.support import captured_stderr, cpython_only, infinite_recursion, requires_docstrings
from test.typinganndata import ann_module695, mod_generics_cache, _typed_dict_helper


Expand Down Expand Up @@ -10241,6 +10241,7 @@ def test_constructor(self):
def test_repr(self):
self.assertEqual(repr(NoDefault), 'typing.NoDefault')

@requires_docstrings
def test_doc(self):
self.assertIsInstance(NoDefault.__doc__, str)
Comment thread
JelleZijlstra marked this conversation as resolved.

Expand All @@ -10260,6 +10261,8 @@ def test_no_attributes(self):
# TypeError is consistent with the behavior of NoneType
with self.assertRaises(TypeError):
Comment thread
JelleZijlstra marked this conversation as resolved.
type(NoDefault).foo = 3
with self.assertRaises(AttributeError):
type(NoDefault).foo


class AllTests(BaseTestCase):
Expand Down