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

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

Issue 25958: Implicit ABCs have no means of "anti-registration"
Left Patch Set: Created 4 years, 3 months ago
Right Patch Set: Created 3 years, 7 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_bytes.py ('k') | Lib/test/test_contains.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 """Unit tests for collections.py.""" 1 """Unit tests for collections.py."""
2 2
3 import collections 3 import collections
4 import copy 4 import copy
5 import doctest 5 import doctest
6 import inspect 6 import inspect
7 import keyword 7 import keyword
8 import operator 8 import operator
9 import pickle 9 import pickle
10 from random import choice, randrange 10 from random import choice, randrange
11 import re 11 import re
12 import string 12 import string
13 import sys 13 import sys
14 from test import support 14 from test import support
15 import types 15 import types
16 import unittest 16 import unittest
17 17
18 from collections import namedtuple, Counter, OrderedDict, _count_elements 18 from collections import namedtuple, Counter, OrderedDict, _count_elements
19 from collections import UserDict, UserString, UserList 19 from collections import UserDict, UserString, UserList
20 from collections import ChainMap 20 from collections import ChainMap
21 from collections import deque 21 from collections import deque
22 from collections.abc import Awaitable, Coroutine, AsyncIterator, AsyncIterable 22 from collections.abc import Awaitable, Coroutine, AsyncIterator, AsyncIterable
23 from collections.abc import Hashable, Iterable, Iterator, Generator 23 from collections.abc import Hashable, Iterable, Iterator, Generator, Reversible
24 from collections.abc import Sized, Container, Reversible, Callable 24 from collections.abc import Sized, Container, Callable
25 from collections.abc import Set, MutableSet 25 from collections.abc import Set, MutableSet
26 from collections.abc import Mapping, MutableMapping, KeysView, ItemsView 26 from collections.abc import Mapping, MutableMapping, KeysView, ItemsView, Values View
27 from collections.abc import Sequence, MutableSequence 27 from collections.abc import Sequence, MutableSequence
28 from collections.abc import ByteString 28 from collections.abc import ByteString
29 29
30 30
31 class TestUserObjects(unittest.TestCase): 31 class TestUserObjects(unittest.TestCase):
32 def _superset_test(self, a, b): 32 def _superset_test(self, a, b):
33 self.assertGreaterEqual( 33 self.assertGreaterEqual(
34 set(dir(a)), 34 set(dir(a)),
35 set(dir(b)), 35 set(dir(b)),
36 '{a} should have all the methods of {b}'.format( 36 '{a} should have all the methods of {b}'.format(
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 for m1, m2 in zip(d.maps, e.maps): 107 for m1, m2 in zip(d.maps, e.maps):
108 self.assertIsNot(m1, m2, e) 108 self.assertIsNot(m1, m2, e)
109 109
110 f = d.new_child() 110 f = d.new_child()
111 f['b'] = 5 111 f['b'] = 5
112 self.assertEqual(f.maps, [{'b': 5}, {'c':30}, {'a':1, 'b':2}]) 112 self.assertEqual(f.maps, [{'b': 5}, {'c':30}, {'a':1, 'b':2}])
113 self.assertEqual(f.parents.maps, [{'c':30}, {'a':1, 'b':2}]) # check p arents 113 self.assertEqual(f.parents.maps, [{'c':30}, {'a':1, 'b':2}]) # check p arents
114 self.assertEqual(f['b'], 5) # find fi rst in chain 114 self.assertEqual(f['b'], 5) # find fi rst in chain
115 self.assertEqual(f.parents['b'], 2) # look be yond maps[0] 115 self.assertEqual(f.parents['b'], 2) # look be yond maps[0]
116 116
117 def test_contructor(self): 117 def test_constructor(self):
118 self.assertEqual(ChainMap().maps, [{}]) # no-args --> one new dict 118 self.assertEqual(ChainMap().maps, [{}]) # no-args --> one new dict
119 self.assertEqual(ChainMap({1:2}).maps, [{1:2}]) # 1 arg - -> list 119 self.assertEqual(ChainMap({1:2}).maps, [{1:2}]) # 1 arg - -> list
120 120
121 def test_bool(self): 121 def test_bool(self):
122 self.assertFalse(ChainMap()) 122 self.assertFalse(ChainMap())
123 self.assertFalse(ChainMap({}, {})) 123 self.assertFalse(ChainMap({}, {}))
124 self.assertTrue(ChainMap({1:2}, {})) 124 self.assertTrue(ChainMap({1:2}, {}))
125 self.assertTrue(ChainMap({}, {1:2})) 125 self.assertTrue(ChainMap({}, {1:2}))
126 126
127 def test_missing(self): 127 def test_missing(self):
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 __rsub__ = __eq__ 480 __rsub__ = __eq__
481 481
482 for name, op in operators.items(): 482 for name, op in operators.items():
483 if not hasattr(instance, name): 483 if not hasattr(instance, name):
484 continue 484 continue
485 other = Other() 485 other = Other()
486 op(instance, other) 486 op(instance, other)
487 self.assertTrue(other.right_side,'Right side not called for %s.%s' 487 self.assertTrue(other.right_side,'Right side not called for %s.%s'
488 % (type(instance), name)) 488 % (type(instance), name))
489 489
490 def _test_gen():
491 yield
492
490 class TestOneTrickPonyABCs(ABCTestCase): 493 class TestOneTrickPonyABCs(ABCTestCase):
491 494
492 def test_Awaitable(self): 495 def test_Awaitable(self):
493 def gen(): 496 def gen():
494 yield 497 yield
495 498
496 @types.coroutine 499 @types.coroutine
497 def coro(): 500 def coro():
498 yield 501 yield
499 502
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 def test_Iterable(self): 670 def test_Iterable(self):
668 # Check some non-iterables 671 # Check some non-iterables
669 non_samples = [None, 42, 3.14, 1j] 672 non_samples = [None, 42, 3.14, 1j]
670 for x in non_samples: 673 for x in non_samples:
671 self.assertNotIsInstance(x, Iterable) 674 self.assertNotIsInstance(x, Iterable)
672 self.assertFalse(issubclass(type(x), Iterable), repr(type(x))) 675 self.assertFalse(issubclass(type(x), Iterable), repr(type(x)))
673 # Check some iterables 676 # Check some iterables
674 samples = [bytes(), str(), 677 samples = [bytes(), str(),
675 tuple(), list(), set(), frozenset(), dict(), 678 tuple(), list(), set(), frozenset(), dict(),
676 dict().keys(), dict().items(), dict().values(), 679 dict().keys(), dict().items(), dict().values(),
677 (lambda: (yield))(), 680 _test_gen(),
678 (x for x in []), 681 (x for x in []),
679 ] 682 ]
680 for x in samples: 683 for x in samples:
681 self.assertIsInstance(x, Iterable) 684 self.assertIsInstance(x, Iterable)
682 self.assertTrue(issubclass(type(x), Iterable), repr(type(x))) 685 self.assertTrue(issubclass(type(x), Iterable), repr(type(x)))
683 # Check direct subclassing 686 # Check direct subclassing
684 class I(Iterable): 687 class I(Iterable):
685 def __iter__(self): 688 def __iter__(self):
686 return super().__iter__() 689 return super().__iter__()
687 self.assertEqual(list(I()), []) 690 self.assertEqual(list(I()), [])
688 self.assertFalse(issubclass(str, I)) 691 self.assertFalse(issubclass(str, I))
689 self.validate_abstract_methods(Iterable, '__iter__') 692 self.validate_abstract_methods(Iterable, '__iter__')
690 self.validate_isinstance(Iterable, '__iter__') 693 self.validate_isinstance(Iterable, '__iter__')
691 # Check None blocking 694 # Check None blocking
692 class J: 695 class It:
storchaka 2016/01/05 21:48:04 Could you please use more descriptive names?
abarnert 2016/01/05 23:28:55 I was following the pattern established in this fi
storchaka 2016/01/06 00:04:31 I is an abbreviation of Iterable, it is good, as w
693 def __iter__(self): return iter([]) 696 def __iter__(self): return iter([])
694 class K(J): 697 class ItBlocked(It):
695 __iter__ = None 698 __iter__ = None
696 self.assertTrue(issubclass(J, Iterable)) 699 self.assertTrue(issubclass(It, Iterable))
697 self.assertTrue(isinstance(J(), Iterable)) 700 self.assertTrue(isinstance(It(), Iterable))
698 self.assertFalse(issubclass(K, Iterable)) 701 self.assertFalse(issubclass(ItBlocked, Iterable))
699 self.assertFalse(isinstance(K(), Iterable)) 702 self.assertFalse(isinstance(ItBlocked(), Iterable))
700 703
701 def test_Reversible(self): 704 def test_Reversible(self):
702 # Check some non-iterables 705 # Check some non-reversibles
703 non_iterables = [None, 42, 3.14, 1j] 706 non_samples = [None, 42, 3.14, 1j, dict(), set(), frozenset()]
704 for x in non_iterables: 707 for x in non_samples:
705 self.assertNotIsInstance(x, Reversible) 708 self.assertNotIsInstance(x, Reversible)
706 self.assertFalse(issubclass(type(x), Reversible), repr(type(x))) 709 self.assertFalse(issubclass(type(x), Reversible), repr(type(x)))
707 # Check some non-reversible iterables 710 # Check some non-reversible iterables
708 non_reversibles = [set(), frozenset(), dict(), dict().keys(), 711 non_reversibles = [dict().keys(), dict().items(), dict().values(),
709 dict().items(), dict().values(),
710 Counter(), Counter().keys(), Counter().items(), 712 Counter(), Counter().keys(), Counter().items(),
711 Counter().values(), (lambda: (yield))(), 713 Counter().values(), _test_gen(),
712 (x for x in []), iter([]), reversed([]) 714 (x for x in []), iter([]), reversed([])]
713 ]
714 for x in non_reversibles: 715 for x in non_reversibles:
715 self.assertNotIsInstance(x, Reversible) 716 self.assertNotIsInstance(x, Reversible)
716 self.assertFalse(issubclass(type(x), Reversible), repr(type(x))) 717 self.assertFalse(issubclass(type(x), Reversible), repr(type(x)))
717 # Check some reversible iterables 718 # Check some reversible iterables
718 samples = [bytes(), str(), 719 samples = [bytes(), str(), tuple(), list(), OrderedDict(),
719 tuple(), list(), OrderedDict(), OrderedDict().keys(), 720 OrderedDict().keys(), OrderedDict().items(),
720 OrderedDict().items(), OrderedDict().values(), 721 OrderedDict().values()]
721 ]
722 for x in samples: 722 for x in samples:
723 self.assertIsInstance(x, Reversible) 723 self.assertIsInstance(x, Reversible)
724 self.assertTrue(issubclass(type(x), Reversible), repr(type(x))) 724 self.assertTrue(issubclass(type(x), Reversible), repr(type(x)))
725 # Check also Mapping, MutableMapping, and Sequence
726 self.assertTrue(issubclass(Sequence, Reversible), repr(Sequence))
727 self.assertFalse(issubclass(Mapping, Reversible), repr(Mapping))
728 self.assertFalse(issubclass(MutableMapping, Reversible), repr(MutableMap ping))
725 # Check direct subclassing 729 # Check direct subclassing
726 class R(Reversible): 730 class R(Reversible):
727 def __iter__(self): 731 def __iter__(self):
728 return super().__iter__() 732 return iter(list())
729 def __reversed__(self): 733 def __reversed__(self):
730 return super().__reversed__() 734 return iter(list())
731 self.assertEqual(list(R()), []) 735 self.assertEqual(list(reversed(R())), [])
732 self.assertEqual(list(reversed(R())), list(reversed([]))) 736 self.assertFalse(issubclass(float, R))
733 self.assertFalse(issubclass(str, R))
734 self.validate_abstract_methods(Reversible, '__reversed__', '__iter__') 737 self.validate_abstract_methods(Reversible, '__reversed__', '__iter__')
738 # Check reversible non-iterable (which is not Reversible)
739 class RevNoIter:
740 def __reversed__(self): return reversed([])
741 class RevPlusIter(RevNoIter):
742 def __iter__(self): return iter([])
743 self.assertFalse(issubclass(RevNoIter, Reversible))
744 self.assertFalse(isinstance(RevNoIter(), Reversible))
745 self.assertTrue(issubclass(RevPlusIter, Reversible))
746 self.assertTrue(isinstance(RevPlusIter(), Reversible))
735 # Check None blocking 747 # Check None blocking
736 class J: 748 class Rev:
737 def __iter__(self): return iter([]) 749 def __iter__(self): return iter([])
738 def __reversed__(self): return reversed([]) 750 def __reversed__(self): return reversed([])
739 class K(J): 751 class RevItBlocked(Rev):
storchaka 2016/01/05 21:48:04 What if just not implement __iter__?
abarnert 2016/01/05 23:28:55 Then you'd inherit the base class's __iter__ and b
storchaka 2016/01/06 00:04:31 I meant that needed a test for a class that implem
740 __iter__ = None 752 __iter__ = None
741 class L(J): 753 class RevRevBlocked(Rev):
742 __reversed__ = None 754 __reversed__ = None
743 self.assertTrue(issubclass(J, Reversible)) 755 self.assertTrue(issubclass(Rev, Reversible))
744 self.assertTrue(isinstance(J(), Reversible)) 756 self.assertTrue(isinstance(Rev(), Reversible))
745 self.assertFalse(issubclass(K, Reversible)) 757 self.assertFalse(issubclass(RevItBlocked, Reversible))
746 self.assertFalse(isinstance(K(), Reversible)) 758 self.assertFalse(isinstance(RevItBlocked(), Reversible))
747 self.assertFalse(issubclass(L, Reversible)) 759 self.assertFalse(issubclass(RevRevBlocked, Reversible))
748 self.assertFalse(isinstance(L(), Reversible)) 760 self.assertFalse(isinstance(RevRevBlocked(), Reversible))
749 761
750 def test_Iterator(self): 762 def test_Iterator(self):
751 non_samples = [None, 42, 3.14, 1j, b"", "", (), [], {}, set()] 763 non_samples = [None, 42, 3.14, 1j, b"", "", (), [], {}, set()]
752 for x in non_samples: 764 for x in non_samples:
753 self.assertNotIsInstance(x, Iterator) 765 self.assertNotIsInstance(x, Iterator)
754 self.assertFalse(issubclass(type(x), Iterator), repr(type(x))) 766 self.assertFalse(issubclass(type(x), Iterator), repr(type(x)))
755 samples = [iter(bytes()), iter(str()), 767 samples = [iter(bytes()), iter(str()),
756 iter(tuple()), iter(list()), iter(dict()), 768 iter(tuple()), iter(list()), iter(dict()),
757 iter(set()), iter(frozenset()), 769 iter(set()), iter(frozenset()),
758 iter(dict().keys()), iter(dict().items()), 770 iter(dict().keys()), iter(dict().items()),
759 iter(dict().values()), 771 iter(dict().values()),
760 (lambda: (yield))(), 772 _test_gen(),
761 (x for x in []), 773 (x for x in []),
762 ] 774 ]
763 for x in samples: 775 for x in samples:
764 self.assertIsInstance(x, Iterator) 776 self.assertIsInstance(x, Iterator)
765 self.assertTrue(issubclass(type(x), Iterator), repr(type(x))) 777 self.assertTrue(issubclass(type(x), Iterator), repr(type(x)))
766 self.validate_abstract_methods(Iterator, '__next__', '__iter__') 778 self.validate_abstract_methods(Iterator, '__next__', '__iter__')
767 779
768 # Issue 10565 780 # Issue 10565
769 class NextOnly: 781 class NextOnly:
770 def __next__(self): 782 def __next__(self):
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 self.assertRaises(ValueError, FailOnClose().close) 850 self.assertRaises(ValueError, FailOnClose().close)
839 851
840 class IgnoreGeneratorExit(Generator): 852 class IgnoreGeneratorExit(Generator):
841 def send(self, value): return value 853 def send(self, value): return value
842 def throw(self, *args): pass 854 def throw(self, *args): pass
843 855
844 self.assertRaises(RuntimeError, IgnoreGeneratorExit().close) 856 self.assertRaises(RuntimeError, IgnoreGeneratorExit().close)
845 857
846 def test_Sized(self): 858 def test_Sized(self):
847 non_samples = [None, 42, 3.14, 1j, 859 non_samples = [None, 42, 3.14, 1j,
848 (lambda: (yield))(), 860 _test_gen(),
849 (x for x in []), 861 (x for x in []),
850 ] 862 ]
851 for x in non_samples: 863 for x in non_samples:
852 self.assertNotIsInstance(x, Sized) 864 self.assertNotIsInstance(x, Sized)
853 self.assertFalse(issubclass(type(x), Sized), repr(type(x))) 865 self.assertFalse(issubclass(type(x), Sized), repr(type(x)))
854 samples = [bytes(), str(), 866 samples = [bytes(), str(),
855 tuple(), list(), set(), frozenset(), dict(), 867 tuple(), list(), set(), frozenset(), dict(),
856 dict().keys(), dict().items(), dict().values(), 868 dict().keys(), dict().items(), dict().values(),
857 ] 869 ]
858 for x in samples: 870 for x in samples:
859 self.assertIsInstance(x, Sized) 871 self.assertIsInstance(x, Sized)
860 self.assertTrue(issubclass(type(x), Sized), repr(type(x))) 872 self.assertTrue(issubclass(type(x), Sized), repr(type(x)))
861 self.validate_abstract_methods(Sized, '__len__') 873 self.validate_abstract_methods(Sized, '__len__')
862 self.validate_isinstance(Sized, '__len__') 874 self.validate_isinstance(Sized, '__len__')
863 875
864 def test_Container(self): 876 def test_Container(self):
865 non_samples = [None, 42, 3.14, 1j, 877 non_samples = [None, 42, 3.14, 1j,
866 (lambda: (yield))(), 878 _test_gen(),
867 (x for x in []), 879 (x for x in []),
868 ] 880 ]
869 for x in non_samples: 881 for x in non_samples:
870 self.assertNotIsInstance(x, Container) 882 self.assertNotIsInstance(x, Container)
871 self.assertFalse(issubclass(type(x), Container), repr(type(x))) 883 self.assertFalse(issubclass(type(x), Container), repr(type(x)))
872 samples = [bytes(), str(), 884 samples = [bytes(), str(),
873 tuple(), list(), set(), frozenset(), dict(), 885 tuple(), list(), set(), frozenset(), dict(),
874 dict().keys(), dict().items(), 886 dict().keys(), dict().items(),
875 ] 887 ]
876 for x in samples: 888 for x in samples:
877 self.assertIsInstance(x, Container) 889 self.assertIsInstance(x, Container)
878 self.assertTrue(issubclass(type(x), Container), repr(type(x))) 890 self.assertTrue(issubclass(type(x), Container), repr(type(x)))
879 self.validate_abstract_methods(Container, '__contains__') 891 self.validate_abstract_methods(Container, '__contains__')
880 self.validate_isinstance(Container, '__contains__') 892 self.validate_isinstance(Container, '__contains__')
881 893
882 def test_Callable(self): 894 def test_Callable(self):
883 non_samples = [None, 42, 3.14, 1j, 895 non_samples = [None, 42, 3.14, 1j,
884 "", b"", (), [], {}, set(), 896 "", b"", (), [], {}, set(),
885 (lambda: (yield))(), 897 _test_gen(),
886 (x for x in []), 898 (x for x in []),
887 ] 899 ]
888 for x in non_samples: 900 for x in non_samples:
889 self.assertNotIsInstance(x, Callable) 901 self.assertNotIsInstance(x, Callable)
890 self.assertFalse(issubclass(type(x), Callable), repr(type(x))) 902 self.assertFalse(issubclass(type(x), Callable), repr(type(x)))
891 samples = [lambda: None, 903 samples = [lambda: None,
892 type, int, object, 904 type, int, object,
893 len, 905 len,
894 list.append, [].append, 906 list.append, [].append,
895 ] 907 ]
896 for x in samples: 908 for x in samples:
897 self.assertIsInstance(x, Callable) 909 self.assertIsInstance(x, Callable)
898 self.assertTrue(issubclass(type(x), Callable), repr(type(x))) 910 self.assertTrue(issubclass(type(x), Callable), repr(type(x)))
899 self.validate_abstract_methods(Callable, '__call__') 911 self.validate_abstract_methods(Callable, '__call__')
900 self.validate_isinstance(Callable, '__call__') 912 self.validate_isinstance(Callable, '__call__')
901 913
902 def test_direct_subclassing(self): 914 def test_direct_subclassing(self):
903 for B in Hashable, Iterable, Iterator, Sized, Container, Callable: 915 for B in Hashable, Iterable, Iterator, Reversible, Sized, Container, Cal lable:
904 class C(B): 916 class C(B):
905 pass 917 pass
906 self.assertTrue(issubclass(C, B)) 918 self.assertTrue(issubclass(C, B))
907 self.assertFalse(issubclass(int, C)) 919 self.assertFalse(issubclass(int, C))
908 920
909 def test_registration(self): 921 def test_registration(self):
910 for B in Hashable, Iterable, Iterator, Sized, Container, Callable: 922 for B in Hashable, Iterable, Iterator, Reversible, Sized, Container, Cal lable:
911 class C: 923 class C:
912 __hash__ = None # Make sure it isn't hashable by default 924 __hash__ = None # Make sure it isn't hashable by default
913 self.assertFalse(issubclass(C, B), B.__name__) 925 self.assertFalse(issubclass(C, B), B.__name__)
914 B.register(C) 926 B.register(C)
915 self.assertTrue(issubclass(C, B)) 927 self.assertTrue(issubclass(C, B))
916 928
917 class WithSet(MutableSet): 929 class WithSet(MutableSet):
918 930
919 def __init__(self, it=()): 931 def __init__(self, it=()):
920 self.data = set(it) 932 self.data = set(it)
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 return NotImplemented 1111 return NotImplemented
1100 def __lt__(self, x): 1112 def __lt__(self, x):
1101 return NotImplemented 1113 return NotImplemented
1102 1114
1103 cs = MyComparableSet() 1115 cs = MyComparableSet()
1104 ncs = MyNonComparableSet() 1116 ncs = MyNonComparableSet()
1105 self.assertFalse(ncs < cs) 1117 self.assertFalse(ncs < cs)
1106 self.assertTrue(ncs <= cs) 1118 self.assertTrue(ncs <= cs)
1107 self.assertFalse(ncs > cs) 1119 self.assertFalse(ncs > cs)
1108 self.assertTrue(ncs >= cs) 1120 self.assertTrue(ncs >= cs)
1121
1122 def test_issue26915(self):
1123 # Container membership test should check identity first
1124 class CustomEqualObject:
1125 def __eq__(self, other):
1126 return False
1127 class CustomSequence(list):
1128 def __contains__(self, value):
1129 return Sequence.__contains__(self, value)
1130
1131 nan = float('nan')
1132 obj = CustomEqualObject()
1133 containers = [
1134 CustomSequence([nan, obj]),
1135 ItemsView({1: nan, 2: obj}),
1136 ValuesView({1: nan, 2: obj})
1137 ]
1138 for container in containers:
1139 for elem in container:
1140 self.assertIn(elem, container)
1109 1141
1110 def assertSameSet(self, s1, s2): 1142 def assertSameSet(self, s1, s2):
1111 # coerce both to a real set then check equality 1143 # coerce both to a real set then check equality
1112 self.assertSetEqual(set(s1), set(s2)) 1144 self.assertSetEqual(set(s1), set(s2))
1113 1145
1114 def test_Set_interoperability_with_real_sets(self): 1146 def test_Set_interoperability_with_real_sets(self):
1115 # Issue: 8743 1147 # Issue: 8743
1116 class ListSet(Set): 1148 class ListSet(Set):
1117 def __init__(self, elements=()): 1149 def __init__(self, elements=()):
1118 self.data = [] 1150 self.data = []
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
1690 test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs, 1722 test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs,
1691 TestCollectionABCs, TestCounter, TestChainMap, 1723 TestCollectionABCs, TestCounter, TestChainMap,
1692 TestUserObjects, 1724 TestUserObjects,
1693 ] 1725 ]
1694 support.run_unittest(*test_classes) 1726 support.run_unittest(*test_classes)
1695 support.run_doctest(collections, verbose) 1727 support.run_doctest(collections, verbose)
1696 1728
1697 1729
1698 if __name__ == "__main__": 1730 if __name__ == "__main__":
1699 test_main(verbose=True) 1731 test_main(verbose=True)
LEFTRIGHT

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