summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pathlib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_pathlib')
-rw-r--r--Lib/test/test_pathlib/test_pathlib.py13
-rw-r--r--Lib/test/test_pathlib/test_pathlib_abc.py7
2 files changed, 13 insertions, 7 deletions
diff --git a/Lib/test/test_pathlib/test_pathlib.py b/Lib/test/test_pathlib/test_pathlib.py
index b64e6b5..93fe327 100644
--- a/Lib/test/test_pathlib/test_pathlib.py
+++ b/Lib/test/test_pathlib/test_pathlib.py
@@ -214,6 +214,19 @@ class PurePathTest(test_pathlib_abc.DummyPurePathTest):
self.assertEqual(q, p)
self.assertEqual(repr(q), r)
+ def test_relative_to_several_args(self):
+ P = self.cls
+ p = P('a/b')
+ with self.assertWarns(DeprecationWarning):
+ p.relative_to('a', 'b')
+ p.relative_to('a', 'b', walk_up=True)
+
+ def test_is_relative_to_several_args(self):
+ P = self.cls
+ p = P('a/b')
+ with self.assertWarns(DeprecationWarning):
+ p.is_relative_to('a', 'b')
+
class PurePosixPathTest(PurePathTest):
cls = pathlib.PurePosixPath
diff --git a/Lib/test/test_pathlib/test_pathlib_abc.py b/Lib/test/test_pathlib/test_pathlib_abc.py
index a67235b..3a7c036 100644
--- a/Lib/test/test_pathlib/test_pathlib_abc.py
+++ b/Lib/test/test_pathlib/test_pathlib_abc.py
@@ -542,10 +542,6 @@ class DummyPurePathTest(unittest.TestCase):
self.assertEqual(p.relative_to('a/b/c', walk_up=True), P('..'))
self.assertEqual(p.relative_to(P('c'), walk_up=True), P('../a/b'))
self.assertEqual(p.relative_to('c', walk_up=True), P('../a/b'))
- # With several args.
- with self.assertWarns(DeprecationWarning):
- p.relative_to('a', 'b')
- p.relative_to('a', 'b', walk_up=True)
# Unrelated paths.
self.assertRaises(ValueError, p.relative_to, P('c'))
self.assertRaises(ValueError, p.relative_to, P('a/b/c'))
@@ -607,9 +603,6 @@ class DummyPurePathTest(unittest.TestCase):
self.assertTrue(p.is_relative_to('a/'))
self.assertTrue(p.is_relative_to(P('a/b')))
self.assertTrue(p.is_relative_to('a/b'))
- # With several args.
- with self.assertWarns(DeprecationWarning):
- p.is_relative_to('a', 'b')
# Unrelated paths.
self.assertFalse(p.is_relative_to(P('c')))
self.assertFalse(p.is_relative_to(P('a/b/c')))