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

Delta Between Two Patch Sets: Lib/test/test_builtin.py

Issue 16510: Using appropriate checks in tests
Left Patch Set: Created 6 years ago
Right Patch Set: Created 5 years, 10 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Lib/test/test_buffer.py ('k') | Lib/test/test_bz2.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 # Python test set -- built-in functions 1 # Python test set -- built-in functions
2 2
3 import ast 3 import ast
4 import builtins 4 import builtins
5 import collections 5 import collections
6 import io 6 import io
7 import locale 7 import locale
8 import os 8 import os
9 import pickle 9 import pickle
10 import platform 10 import platform
(...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 1585
1586 s = ''.join(set(s)) # unique letters only 1586 s = ''.join(set(s)) # unique letters only
1587 types = [str, set, frozenset, list, tuple, dict.fromkeys] 1587 types = [str, set, frozenset, list, tuple, dict.fromkeys]
1588 for T in types: 1588 for T in types:
1589 self.assertEqual(sorted(s), sorted(T(s))) 1589 self.assertEqual(sorted(s), sorted(T(s)))
1590 1590
1591 def test_baddecorator(self): 1591 def test_baddecorator(self):
1592 data = 'The quick Brown fox Jumped over The lazy Dog'.split() 1592 data = 'The quick Brown fox Jumped over The lazy Dog'.split()
1593 self.assertRaises(TypeError, sorted, data, None, lambda x,y: 0) 1593 self.assertRaises(TypeError, sorted, data, None, lambda x,y: 0)
1594 1594
1595 def test_main(verbose=None): 1595 def load_tests(loader, tests, pattern):
1596 test_classes = (BuiltinTest, TestSorted) 1596 from doctest import DocTestSuite
1597 1597 tests.addTest(DocTestSuite(builtins))
1598 run_unittest(*test_classes) 1598 return tests
1599
1600 # verify reference counting
1601 if verbose and hasattr(sys, "gettotalrefcount"):
1602 import gc
1603 counts = [None] * 5
1604 for i in range(len(counts)):
1605 run_unittest(*test_classes)
1606 gc.collect()
1607 counts[i] = sys.gettotalrefcount()
1608 print(counts)
1609
1610 1599
1611 if __name__ == "__main__": 1600 if __name__ == "__main__":
1612 test_main(verbose=True) 1601 unittest.main()
LEFTRIGHT

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