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

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

Issue 16510: Using appropriate checks in tests
Patch Set: Created 5 years, 8 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_pyexpat.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, captured_stdout 2 cpython_only, captured_stdout
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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 iter = pat.finditer("a:b::c:::d", endpos=10, pos=1) 890 iter = pat.finditer("a:b::c:::d", endpos=10, pos=1)
891 self.assertEqual([item.group(0) for item in iter], 891 self.assertEqual([item.group(0) for item in iter],
892 [":", "::", ":::"]) 892 [":", "::", ":::"])
893 893
894 pat = re.compile(r":+") 894 pat = re.compile(r":+")
895 iter = pat.finditer("a:b::c:::d", pos=3, endpos=8) 895 iter = pat.finditer("a:b::c:::d", pos=3, endpos=8)
896 self.assertEqual([item.group(0) for item in iter], 896 self.assertEqual([item.group(0) for item in iter],
897 ["::", "::"]) 897 ["::", "::"])
898 898
899 def test_bug_926075(self): 899 def test_bug_926075(self):
900 self.assertTrue(re.compile('bug_926075') is not 900 self.assertIsNot(re.compile('bug_926075'),
901 re.compile(b'bug_926075')) 901 re.compile(b'bug_926075'))
902 902
903 def test_bug_931848(self): 903 def test_bug_931848(self):
904 pattern = eval('"[\u002E\u3002\uFF0E\uFF61]"') 904 pattern = eval('"[\u002E\u3002\uFF0E\uFF61]"')
905 self.assertEqual(re.compile(pattern).split("a.b.c"), 905 self.assertEqual(re.compile(pattern).split("a.b.c"),
906 ['a','b','c']) 906 ['a','b','c'])
907 907
908 def test_bug_581080(self): 908 def test_bug_581080(self):
909 iter = re.finditer(r"\s", "a b") 909 iter = re.finditer(r"\s", "a b")
910 self.assertEqual(next(iter).span(), (1,2)) 910 self.assertEqual(next(iter).span(), (1,2))
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1410 if result is None: 1410 if result is None:
1411 print('=== Fails on unicode-sensitive match', t) 1411 print('=== Fails on unicode-sensitive match', t)
1412 1412
1413 1413
1414 def test_main(): 1414 def test_main():
1415 run_unittest(__name__) 1415 run_unittest(__name__)
1416 run_re_tests() 1416 run_re_tests()
1417 1417
1418 if __name__ == "__main__": 1418 if __name__ == "__main__":
1419 test_main() 1419 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_pyexpat.py ('k') | Lib/test/test_richcmp.py » ('j') | no next file with comments »

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