summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-02-19 11:52:35 (GMT)
committerGitHub <noreply@github.com>2019-02-19 11:52:35 (GMT)
commit8d01eb49fc7ff914feeb2e2090d1d6ef15c932ab (patch)
treecfb4afe5d5229f20c08046fd23e7c4986b50ca79 /Lib
parent8e79e6e56f516385ccb761e407dfff3a39253180 (diff)
downloadcpython-8d01eb49fc7ff914feeb2e2090d1d6ef15c932ab.zip
cpython-8d01eb49fc7ff914feeb2e2090d1d6ef15c932ab.tar.gz
cpython-8d01eb49fc7ff914feeb2e2090d1d6ef15c932ab.tar.bz2
Fix syntax warnings in tests introduced in bpo-35942. (GH-11934)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_os.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index d478c64..2cfcebc 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -3358,20 +3358,12 @@ class PathTConverterTests(unittest.TestCase):
fn(fd, *extra_args)
def test_path_t_converter_and_custom_class(self):
- with self.assertRaisesRegex(
- TypeError,
- '__fspath__\(\) to return str or bytes, not int'
- ):
+ msg = r'__fspath__\(\) to return str or bytes, not %s'
+ with self.assertRaisesRegex(TypeError, msg % r'int'):
os.stat(FakePath(2))
- with self.assertRaisesRegex(
- TypeError,
- '__fspath__\(\) to return str or bytes, not float'
- ):
+ with self.assertRaisesRegex(TypeError, msg % r'float'):
os.stat(FakePath(2.34))
- with self.assertRaisesRegex(
- TypeError,
- '__fspath__\(\) to return str or bytes, not object'
- ):
+ with self.assertRaisesRegex(TypeError, msg % r'object'):
os.stat(FakePath(object()))