diff options
Diffstat (limited to 'Lib/test/test_pathlib.py')
-rw-r--r-- | Lib/test/test_pathlib.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py index 6672c44..a4d2f8d 100644 --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -11,7 +11,7 @@ import unittest from unittest import mock from test import support -TESTFN = support.TESTFN +from test.support import TESTFN, FakePath try: import grp, pwd @@ -191,18 +191,15 @@ class _BasePurePathTest(object): P = self.cls p = P('a') self.assertIsInstance(p, P) - class PathLike: - def __fspath__(self): - return "a/b/c" P('a', 'b', 'c') P('/a', 'b', 'c') P('a/b/c') P('/a/b/c') - P(PathLike()) + P(FakePath("a/b/c")) self.assertEqual(P(P('a')), P('a')) self.assertEqual(P(P('a'), 'b'), P('a/b')) self.assertEqual(P(P('a'), P('b')), P('a/b')) - self.assertEqual(P(P('a'), P('b'), P('c')), P(PathLike())) + self.assertEqual(P(P('a'), P('b'), P('c')), P(FakePath("a/b/c"))) def _check_str_subclass(self, *args): # Issue #21127: it should be possible to construct a PurePath object |