Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2420)

Side by Side Diff: Lib/test/test_re.py

Issue 16510: Using appropriate checks in tests
Patch Set: Created 5 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_raise.py ('k') | Lib/test/test_richcmp.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \ 1 from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
2 cpython_only 2 cpython_only
3 import io 3 import io
4 import re 4 import re
5 from re import Scanner 5 from re import Scanner
6 import sre_compile 6 import sre_compile
7 import sre_constants 7 import sre_constants
8 import sys 8 import sys
9 import string 9 import string
10 import traceback 10 import traceback
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 iter = pat.finditer("a:b::c:::d", endpos=10, pos=1) 860 iter = pat.finditer("a:b::c:::d", endpos=10, pos=1)
861 self.assertEqual([item.group(0) for item in iter], 861 self.assertEqual([item.group(0) for item in iter],
862 [":", "::", ":::"]) 862 [":", "::", ":::"])
863 863
864 pat = re.compile(r":+") 864 pat = re.compile(r":+")
865 iter = pat.finditer("a:b::c:::d", pos=3, endpos=8) 865 iter = pat.finditer("a:b::c:::d", pos=3, endpos=8)
866 self.assertEqual([item.group(0) for item in iter], 866 self.assertEqual([item.group(0) for item in iter],
867 ["::", "::"]) 867 ["::", "::"])
868 868
869 def test_bug_926075(self): 869 def test_bug_926075(self):
870 self.assertTrue(re.compile('bug_926075') is not 870 self.assertIsNot(re.compile('bug_926075'),
871 re.compile(b'bug_926075')) 871 re.compile(b'bug_926075'))
872 872
873 def test_bug_931848(self): 873 def test_bug_931848(self):
874 pattern = eval('"[\u002E\u3002\uFF0E\uFF61]"') 874 pattern = eval('"[\u002E\u3002\uFF0E\uFF61]"')
875 self.assertEqual(re.compile(pattern).split("a.b.c"), 875 self.assertEqual(re.compile(pattern).split("a.b.c"),
876 ['a','b','c']) 876 ['a','b','c'])
877 877
878 def test_bug_581080(self): 878 def test_bug_581080(self):
879 iter = re.finditer(r"\s", "a b") 879 iter = re.finditer(r"\s", "a b")
880 self.assertEqual(next(iter).span(), (1,2)) 880 self.assertEqual(next(iter).span(), (1,2))
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 if result is None: 1306 if result is None:
1307 print('=== Fails on unicode-sensitive match', t) 1307 print('=== Fails on unicode-sensitive match', t)
1308 1308
1309 1309
1310 def test_main(): 1310 def test_main():
1311 run_unittest(__name__) 1311 run_unittest(__name__)
1312 run_re_tests() 1312 run_re_tests()
1313 1313
1314 if __name__ == "__main__": 1314 if __name__ == "__main__":
1315 test_main() 1315 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_raise.py ('k') | Lib/test/test_richcmp.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+