summaryrefslogtreecommitdiff
path: root/Lib/test/test_posixpath.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_posixpath.py')
-rw-r--r--Lib/test/test_posixpath.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
index ec2fbaee32..d5a12a31dd 100644
--- a/Lib/test/test_posixpath.py
+++ b/Lib/test/test_posixpath.py
@@ -65,9 +65,13 @@ class PosixPathTest(unittest.TestCase):
with self.assertRaisesRegex(TypeError, errmsg):
posixpath.join('str', b'bytes')
# regression, see #15377
- with self.assertRaises(TypeError) as cm:
+ errmsg = r'join\(\) argument must be str or bytes, not %r'
+ with self.assertRaisesRegex(TypeError, errmsg % 'NoneType'):
posixpath.join(None, 'str')
- self.assertNotEqual(cm.exception.args[0], errmsg)
+ with self.assertRaisesRegex(TypeError, errmsg % 'NoneType'):
+ posixpath.join('str', None)
+ with self.assertRaisesRegex(TypeError, errmsg % 'bytearray'):
+ posixpath.join(bytearray(b'foo'), bytearray(b'bar'))
def test_split(self):
self.assertEqual(posixpath.split("/foo/bar"), ("/foo", "bar"))