summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-02-22 15:59:01 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-02-22 15:59:01 (GMT)
commit19e4acfa15ec17a748b26770078aad53aa72475f (patch)
tree4a5c4429e74258f5320e86600d7d3dd5f894aef3 /Lib/test/test_os.py
parent5961b0e35fa6ff73fd420448270fb3143703c59e (diff)
downloadcpython-19e4acfa15ec17a748b26770078aad53aa72475f.zip
cpython-19e4acfa15ec17a748b26770078aad53aa72475f.tar.gz
cpython-19e4acfa15ec17a748b26770078aad53aa72475f.tar.bz2
#7310: fix the repr() of os.environ
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index cdbc998..1ff356c 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -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()."""