From 5bfc03f430ab13ed84c2c30f2c87e9800b5670a4 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 19 May 2015 11:00:07 +0300 Subject: Issue #23780: Improved error message in os.path.join() with single argument. Idea by R. David Murray. --- Lib/test/test_genericpath.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Lib/test/test_genericpath.py') diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py index f2722bcc8a5..6ba55df8c40 100644 --- a/Lib/test/test_genericpath.py +++ b/Lib/test/test_genericpath.py @@ -448,6 +448,10 @@ class CommonTest(GenericTest): self.pathmodule.join(42, 'str') with self.assertRaisesRegex(TypeError, errmsg % 'int'): self.pathmodule.join('str', 42) + with self.assertRaisesRegex(TypeError, errmsg % 'int'): + self.pathmodule.join(42) + with self.assertRaisesRegex(TypeError, errmsg % 'list'): + self.pathmodule.join([]) with self.assertRaisesRegex(TypeError, errmsg % 'bytearray'): self.pathmodule.join(bytearray(b'foo'), bytearray(b'bar')) -- cgit v1.2.3