Skip to content

Commit c032a85

Browse files
committed
pythongh-58211: Add test to builtin constants bound method
1 parent 0454ca4 commit c032a85

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Lib/test/test_funcattrs.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,20 @@ def test_builtin__self__(self):
504504
d = {'foo': 'bar'}
505505
self.assertEqual(d.pop.__self__, d)
506506

507+
# builtin constants bound method:
508+
self.assertFalse(False.__repr__.__self__)
509+
self.assertIsNone(None.__repr__.__self__)
510+
self.assertTrue(True.__repr__.__self__)
511+
512+
ni = NotImplemented
513+
self.assertIs(ni.__repr__.__self__, ni)
514+
515+
e = Ellipsis
516+
self.assertIs(e.__repr__.__self__, e)
517+
518+
d = __debug__
519+
self.assertIs(d.__repr__.__self__, d)
520+
507521

508522
if __name__ == "__main__":
509523
unittest.main()

0 commit comments

Comments
 (0)