]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] Add vfspath TypeError test (GH-153987) (#154010)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 19 Jul 2026 08:16:03 +0000 (10:16 +0200)
committerGitHub <noreply@github.com>
Sun, 19 Jul 2026 08:16:03 +0000 (08:16 +0000)
Add vfspath TypeError test (GH-153987)

typeerror with message test
(cherry picked from commit 5763bfdd1b582ef30cf3e6dd88754991973c77ce)

Co-authored-by: Ajob Kustra <ajobkustra.p@gmail.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Lib/test/test_pathlib/test_join_windows.py

index f30c80605f7f9104f3e33462335379ed0e462d81..5afefa61b585f3b70d914d17011bb995db2f6b8a 100644 (file)
@@ -87,6 +87,11 @@ class JoinTestBase:
         p = self.cls(r'\\a\b\c\d')
         self.assertEqual(vfspath(p), '\\\\a\\b\\c\\d')
 
+    def test_invalid_vspath(self):
+        msg = "expected JoinablePath object, not NoneType"
+        with self.assertRaisesRegex(TypeError, msg):
+            vfspath(None)
+
     def test_parts(self):
         P = self.cls
         p = P(r'c:a\b')