Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6e855b3

Browse files
[3.13]gh-118899: Add tests forNotImplemented attribute access (GH-118902) (#118968)
gh-118899: Add tests for `NotImplemented` attribute access (GH-118902)(cherry picked from commitec1398e)Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
1 parentd309474 commit6e855b3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

‎Lib/test/test_builtin.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,6 +2139,24 @@ def test_warning_notimplemented(self):
21392139
withself.assertWarns(DeprecationWarning):
21402140
self.assertFalse(notNotImplemented)
21412141

2142+
deftest_singleton_attribute_access(self):
2143+
forsingletonin (NotImplemented,Ellipsis):
2144+
withself.subTest(singleton):
2145+
self.assertIs(type(singleton),singleton.__class__)
2146+
self.assertIs(type(singleton).__class__,type)
2147+
2148+
# Missing instance attributes:
2149+
withself.assertRaises(AttributeError):
2150+
singleton.prop=1
2151+
withself.assertRaises(AttributeError):
2152+
singleton.prop
2153+
2154+
# Missing class attributes:
2155+
withself.assertRaises(TypeError):
2156+
type(singleton).prop=1
2157+
withself.assertRaises(AttributeError):
2158+
type(singleton).prop
2159+
21422160

21432161
classTestBreakpoint(unittest.TestCase):
21442162
defsetUp(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp