Merge pull request #7047 from bluetech/rm-test_assertion-abc

Remove some no-longer-needed compat code in test_assertion
This commit is contained in:
Ran Benita 2020-04-08 22:33:19 +03:00 committed by GitHub
commit eb00182061
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import collections.abc as collections_abc import collections.abc
import sys import sys
import textwrap import textwrap
from typing import Any from typing import Any
@ -623,11 +623,8 @@ class TestAssert_reprcompare:
assert len(expl) > 1 assert len(expl) > 1
def test_Sequence(self): def test_Sequence(self):
if not hasattr(collections_abc, "MutableSequence"): # Test comparing with a Sequence subclass.
pytest.skip("cannot import MutableSequence") class TestSequence(collections.abc.MutableSequence):
MutableSequence = collections_abc.MutableSequence
class TestSequence(MutableSequence): # works with a Sequence subclass
def __init__(self, iterable): def __init__(self, iterable):
self.elements = list(iterable) self.elements = list(iterable)