Merge pull request #3355 from irmen/py37deprfixes
change collections.abc import to fix deprecation warnings on python 3.7
This commit is contained in:
commit
9a62ebf490
|
@ -5,7 +5,7 @@ import pprint
|
||||||
import _pytest._code
|
import _pytest._code
|
||||||
import py
|
import py
|
||||||
import six
|
import six
|
||||||
from collections import Sequence
|
from ..compat import Sequence
|
||||||
|
|
||||||
u = six.text_type
|
u = six.text_type
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,14 @@ PY35 = sys.version_info[:2] >= (3, 5)
|
||||||
PY36 = sys.version_info[:2] >= (3, 6)
|
PY36 = sys.version_info[:2] >= (3, 6)
|
||||||
MODULE_NOT_FOUND_ERROR = 'ModuleNotFoundError' if PY36 else 'ImportError'
|
MODULE_NOT_FOUND_ERROR = 'ModuleNotFoundError' if PY36 else 'ImportError'
|
||||||
|
|
||||||
|
if _PY3:
|
||||||
|
from collections.abc import MutableMapping as MappingMixin # noqa
|
||||||
|
from collections.abc import Sequence # noqa
|
||||||
|
else:
|
||||||
|
# those raise DeprecationWarnings in Python >=3.7
|
||||||
|
from collections import MutableMapping as MappingMixin # noqa
|
||||||
|
from collections import Sequence # noqa
|
||||||
|
|
||||||
|
|
||||||
def _format_args(func):
|
def _format_args(func):
|
||||||
return str(signature(func))
|
return str(signature(func))
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
from collections import namedtuple, MutableMapping as MappingMixin
|
|
||||||
import warnings
|
|
||||||
from operator import attrgetter
|
|
||||||
import inspect
|
import inspect
|
||||||
|
import warnings
|
||||||
|
from collections import namedtuple
|
||||||
|
from operator import attrgetter
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
from ..deprecated import MARK_PARAMETERSET_UNPACKING
|
|
||||||
from ..compat import NOTSET, getfslineno
|
|
||||||
from six.moves import map
|
from six.moves import map
|
||||||
|
|
||||||
|
from ..compat import NOTSET, getfslineno, MappingMixin
|
||||||
|
from ..deprecated import MARK_PARAMETERSET_UNPACKING
|
||||||
|
|
||||||
EMPTY_PARAMETERSET_OPTION = "empty_parameter_set_mark"
|
EMPTY_PARAMETERSET_OPTION = "empty_parameter_set_mark"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Import some modules from ``collections`` instead of ``collections.abc`` as the former modules trigger ``DeprecationWarning`` in Python 3.7.
|
Loading…
Reference in New Issue