summaryrefslogtreecommitdiff
path: root/testing/test_assertion.py
diff options
context:
space:
mode:
authorHynek Schlawack <hs@ox.cx>2019-10-01 20:40:13 +0200
committerHynek Schlawack <hs@ox.cx>2019-10-01 20:47:59 +0200
commita79acf279a80bbbac0a05d8fadf62649753c668a (patch)
tree10d2d41294f4555d6d888d478b0e6aa5e49d7a89 /testing/test_assertion.py
parent9a4c0b991b07dff83896999717545b2b44b38901 (diff)
downloadpytest-a79acf279a80bbbac0a05d8fadf62649753c668a.tar.gz
Fix warnings with attrs 19.2 and fix object assertions
attrs 19.2 deprecated cmp in favor of the dataclass-ish eq/order duo. This causes deprecation warnings that in turn break some of the cool new deep object comparisons. Since we at attrs expected this to be a problem, it shipped with helpers to write backward and forward compatible code. This PR uses that and avoids changed to minimal versions.
Diffstat (limited to 'testing/test_assertion.py')
-rw-r--r--testing/test_assertion.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/testing/test_assertion.py b/testing/test_assertion.py
index bf23e3202..83370fb43 100644
--- a/testing/test_assertion.py
+++ b/testing/test_assertion.py
@@ -9,6 +9,7 @@ import pytest
from _pytest import outcomes
from _pytest.assertion import truncate
from _pytest.assertion import util
+from _pytest.compat import attrs_no_eq
def mock_config():
@@ -687,7 +688,7 @@ class TestAssert_reprcompare_attrsclass:
@attr.s
class SimpleDataObject:
field_a = attr.ib()
- field_b = attr.ib(cmp=False)
+ field_b = attr.ib(**attrs_no_eq)
left = SimpleDataObject(1, "b")
right = SimpleDataObject(1, "b")