summaryrefslogtreecommitdiff
path: root/Lib/test/test_pathlib.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2016-01-30 17:50:48 +0200
committerBerker Peksag <berker.peksag@gmail.com>2016-01-30 17:50:48 +0200
commit4a208e448e80ac1ce2bc805685d68da69dd44841 (patch)
tree9e8fbf4f7bbc612e8faaf7397b92694ec3172d79 /Lib/test/test_pathlib.py
parentef410770a7f7d559ed9a0f36ffc5bae0ebf1ca8d (diff)
downloadcpython-git-4a208e448e80ac1ce2bc805685d68da69dd44841.tar.gz
Issue #23076: Path.glob() now raises a ValueError if it's called with an
invalid pattern. Patch by Thomas Nyberg.
Diffstat (limited to 'Lib/test/test_pathlib.py')
-rw-r--r--Lib/test/test_pathlib.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
index 490d423ca3..b03fee018f 100644
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
@@ -1969,6 +1969,11 @@ class PathTest(_BasePathTest, unittest.TestCase):
else:
self.assertRaises(NotImplementedError, pathlib.WindowsPath)
+ def test_glob_empty_pattern(self):
+ p = self.cls()
+ with self.assertRaisesRegex(ValueError, 'Unacceptable pattern'):
+ list(p.glob(''))
+
@only_posix
class PosixPathTest(_BasePathTest, unittest.TestCase):