mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #19928: Implemented a test for repr() of cell objects.
This commit is contained in:
parent
9df8a1c112
commit
1f79cdfbfa
2 changed files with 11 additions and 3 deletions
|
@ -166,10 +166,16 @@ class ReprTests(unittest.TestCase):
|
|||
eq(r([[[[[[{}]]]]]]), "[[[[[[{}]]]]]]")
|
||||
eq(r([[[[[[[{}]]]]]]]), "[[[[[[[...]]]]]]]")
|
||||
|
||||
@unittest.skip('hard to catch a cell object')
|
||||
def test_cell(self):
|
||||
# XXX Hmm? How to get at a cell object?
|
||||
pass
|
||||
def get_cell():
|
||||
x = 42
|
||||
def inner():
|
||||
return x
|
||||
return inner
|
||||
x = get_cell().__closure__[0]
|
||||
self.assertRegex(repr(x),
|
||||
r'<cell at 0x[0-9a-f]+: int object at 0x[0-9a-f]+>')
|
||||
self.assertRegex(r(x), r'<cell at 0x.*\.\.\..*>')
|
||||
|
||||
def test_descriptors(self):
|
||||
eq = self.assertEqual
|
||||
|
|
|
@ -114,6 +114,8 @@ IDLE
|
|||
Tests
|
||||
-----
|
||||
|
||||
- Issue #19928: Implemented a test for repr() of cell objects.
|
||||
|
||||
- Issue #19535: Fixed test_docxmlrpc when python is run with -OO.
|
||||
|
||||
- Issue #19926: Removed unneeded test_main from test_abstract_numbers.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue