summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_support.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-02-08 14:49:10 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-02-08 14:49:10 (GMT)
commit3722f1f483065338e83ec1e28cd8dc8412ef39d7 (patch)
tree122c93adcad8ade6fda2c96c9511e5e94b3abb45 /Lib/test/test_support.py
parent620580f280e3fe6583afee43580ef907b228add3 (diff)
downloadcpython-3722f1f483065338e83ec1e28cd8dc8412ef39d7.zip
cpython-3722f1f483065338e83ec1e28cd8dc8412ef39d7.tar.gz
cpython-3722f1f483065338e83ec1e28cd8dc8412ef39d7.tar.bz2
support: temp_dir() and change_cwd() uses repr() in error message
Serhiy Storshaka pointed me that str(path) can emit a BytesWarning: use repr(path) instead.
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r--Lib/test/test_support.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index dd0c7bc..0dbe02e 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -158,7 +158,7 @@ class TestSupport(unittest.TestCase):
self.assertEqual(len(warnings), 1, warnings)
warn = warnings[0]
self.assertTrue(warn.startswith(f'tests may fail, unable to create '
- f'temporary directory {path}: '),
+ f'temporary directory {path!r}: '),
warn)
# Tests for change_cwd()
@@ -204,7 +204,7 @@ class TestSupport(unittest.TestCase):
warn = warnings[0]
self.assertTrue(warn.startswith(f'tests may fail, unable to change '
f'the current working directory '
- f'to {bad_dir}: '),
+ f'to {bad_dir!r}: '),
warn)
# Tests for change_cwd()
@@ -221,7 +221,7 @@ class TestSupport(unittest.TestCase):
msg = messages[0]
self.assertTrue(msg.startswith(f'tests may fail, unable to change '
f'the current working directory '
- f'to {path}: '),
+ f'to {path!r}: '),
msg)
# Tests for temp_cwd()