File attrs.patch of Package python-pytest (Revision f213a27bb0b551d0feba19a4a1390029)
Currently displaying revision f213a27bb0b551d0feba19a4a1390029 , Show latest
44
1
Index: pytest-3.10.1/src/_pytest/compat.py
2
===================================================================
3
--- pytest-3.10.1.orig/src/_pytest/compat.py
4
+++ pytest-3.10.1/src/_pytest/compat.py
5
6
import sys
7
from contextlib import contextmanager
8
9
+import attr
10
import py
11
import six
12
from six import text_type
13
14
15
else:
16
from functools import lru_cache # noqa: F401
17
+
18
+if getattr(attr, "__version_info__", ()) >= (19, 2):
19
+ ATTRS_EQ_FIELD = "eq"
20
+else:
21
+ ATTRS_EQ_FIELD = "cmp"
22
Index: pytest-3.10.1/src/_pytest/mark/structures.py
23
===================================================================
24
--- pytest-3.10.1.orig/src/_pytest/mark/structures.py
25
+++ pytest-3.10.1/src/_pytest/mark/structures.py
26
27
from ..compat import getfslineno
28
from ..compat import MappingMixin
29
from ..compat import NOTSET
30
+from ..compat import ATTRS_EQ_FIELD
31
from ..deprecated import MARK_INFO_ATTRIBUTE
32
from ..deprecated import MARK_PARAMETERSET_UNPACKING
33
from _pytest.outcomes import fail
34
35
return "<NodeKeywords for node %s>" % (self.node,)
36
37
38
-@attr.s(cmp=False, hash=False)
39
+# mypy cannot find this overload, remove when on attrs>=19.2
40
+@attr.s(hash=False, **{ATTRS_EQ_FIELD: False}) # type: ignore
41
class NodeMarkers(object):
42
"""
43
internal structure for storing marks belonging to a node
44