diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-01-30 15:51:35 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-01-30 15:51:35 (GMT) |
commit | 396cbd6dfd93ca126772c1e534d28988a6fa29ad (patch) | |
tree | a0162cfa12ccfa65c689040c0a871ba7754fc944 /Lib/test/test_pathlib.py | |
parent | 5586ba7643e608827fc7109a40e851f3cae0f2e4 (diff) | |
parent | 4a208e448e80ac1ce2bc805685d68da69dd44841 (diff) | |
download | cpython-396cbd6dfd93ca126772c1e534d28988a6fa29ad.zip cpython-396cbd6dfd93ca126772c1e534d28988a6fa29ad.tar.gz cpython-396cbd6dfd93ca126772c1e534d28988a6fa29ad.tar.bz2 |
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.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py index b725cd9..9a98d46 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): |