summaryrefslogtreecommitdiff
path: root/Lib/test/test_fnmatch.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_fnmatch.py')
-rw-r--r--Lib/test/test_fnmatch.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_fnmatch.py b/Lib/test/test_fnmatch.py
index 78245c3ab1..55f9f0d3a5 100644
--- a/Lib/test/test_fnmatch.py
+++ b/Lib/test/test_fnmatch.py
@@ -2,6 +2,7 @@
import unittest
import os
+import warnings
from fnmatch import fnmatch, fnmatchcase, translate, filter
@@ -83,6 +84,17 @@ class FnmatchTestCase(unittest.TestCase):
check('usr/bin', 'usr\\bin', normsep)
check('usr\\bin', 'usr\\bin')
+ def test_warnings(self):
+ with warnings.catch_warnings():
+ warnings.simplefilter('error', Warning)
+ check = self.check_match
+ check('[', '[[]')
+ check('&', '[a&&b]')
+ check('|', '[a||b]')
+ check('~', '[a~~b]')
+ check(',', '[a-z+--A-Z]')
+ check('.', '[a-z--/A-Z]')
+
class TranslateTestCase(unittest.TestCase):