mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
#7310: fix the repr() of os.environ
This commit is contained in:
parent
5961b0e35f
commit
19e4acfa15
3 changed files with 20 additions and 0 deletions
|
@ -400,6 +400,14 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
|
|||
for key, value in self._reference().items():
|
||||
self.assertEqual(os.environ.get(key), value)
|
||||
|
||||
# Issue 7310
|
||||
def test___repr__(self):
|
||||
"""Check that the repr() of os.environ looks like environ({...})."""
|
||||
env = os.environ
|
||||
self.assertTrue(isinstance(env.data, dict))
|
||||
self.assertEqual(repr(env), 'environ({!r})'.format(env.data))
|
||||
|
||||
|
||||
class WalkTests(unittest.TestCase):
|
||||
"""Tests for os.walk()."""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue