1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/03f54633875f/ Changeset: 03f54633875f User: hpk42 Date: 2013-08-01 15:38:03 Summary: fix collection imports for python2.5 Affected #: 3 files
diff -r 85e374c5072248cae6bab63ecf9e6cd9fdebf2a5 -r 03f54633875fb0717c70ee9d8308aa501667d7e0 _pytest/assertion/util.py --- a/_pytest/assertion/util.py +++ b/_pytest/assertion/util.py @@ -4,7 +4,11 @@ try: from collections.abc import Sequence except ImportError: - from collections import Sequence + try: + from collections import Sequence + except ImportError: + Sequence = list + BuiltinAssertionError = py.builtin.builtins.AssertionError diff -r 85e374c5072248cae6bab63ecf9e6cd9fdebf2a5 -r 03f54633875fb0717c70ee9d8308aa501667d7e0 testing/conftest.py --- a/testing/conftest.py +++ b/testing/conftest.py @@ -65,7 +65,7 @@ for val in l: metafunc.addcall(funcargs={name: val}) elif 'anypython' in metafunc.fixturenames: - for name in ('python2.4', 'python2.5', 'python2.6', + for name in ('python2.5', 'python2.6', 'python2.7', 'python3.2', "python3.3", 'pypy', 'jython'): metafunc.addcall(id=name, param=name) diff -r 85e374c5072248cae6bab63ecf9e6cd9fdebf2a5 -r 03f54633875fb0717c70ee9d8308aa501667d7e0 testing/test_assertion.py --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -3,12 +3,6 @@ import py, pytest import _pytest.assertion as plugin from _pytest.assertion import reinterpret, util -try: - from collections.abc import MutableSequence -except ImportError: - from collections import MutableSequence - - needsnewassert = pytest.mark.skipif("sys.version_info < (2,6)") @@ -122,6 +116,14 @@ assert len(expl) > 1 def test_Sequence(self): + col = py.builtin._tryimport( + "collections.abc", + "collections", + "sys") + if not hasattr(col, "MutableSequence"): + pytest.skip("cannot import MutableSequence") + MutableSequence = col.MutableSequence + class TestSequence(MutableSequence): # works with a Sequence subclass def __init__(self, iterable): self.elements = list(iterable) Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. _______________________________________________ pytest-commit mailing list pytest-commit@python.org http://mail.python.org/mailman/listinfo/pytest-commit