From a0e66760ecd89e37f6aac9ec547332c494b1f607 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 26 Aug 2024 09:58:14 -0400 Subject: [PATCH] Adjust the expectation in test_malformed_paths to expect empty paths ignored and .. to be a path segment. --- tests/test_path.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_path.py b/tests/test_path.py index fef5a6e..1fa2243 100644 --- a/tests/test_path.py +++ b/tests/test_path.py @@ -585,6 +585,7 @@ def test_getinfo_missing(self, alpharep): with self.assertRaises(KeyError): alpharep.getinfo('does-not-exist') + @pytest.mark.xfail(reason="python/cpython#123270") def test_malformed_paths(self): """ Path should handle malformed paths. @@ -599,8 +600,9 @@ def test_malformed_paths(self): assert list(map(str, root.iterdir())) == [ 'one-slash.txt', 'two-slash.txt', - 'parent.txt', + '..', ] + assert root.joinpath('..').joinpath('parent.txt').read_bytes() == b'content' @pytest.mark.xfail(reason="python/cpython#123270") def test_unsupported_names(self):