|
4 | 4 | Tests for methods from `attrib._cmp`. |
5 | 5 | """ |
6 | 6 |
|
7 | | - |
8 | 7 | import pytest |
9 | 8 |
|
10 | 9 | from attr._cmp import cmp_using |
| 10 | +from attr._compat import PY_3_13_PLUS |
11 | 11 |
|
12 | 12 |
|
13 | 13 | # Test parameters. |
|
54 | 54 | cmp_data = eq_data + order_data |
55 | 55 | cmp_ids = eq_ids + order_ids |
56 | 56 |
|
| 57 | +# Compiler strips indents from docstrings in Python 3.13+ |
| 58 | +indent = "" if PY_3_13_PLUS else " " * 8 |
| 59 | + |
57 | 60 |
|
58 | 61 | class TestEqOrder: |
59 | 62 | """ |
@@ -325,7 +328,7 @@ def test_ne(self): |
325 | 328 | method = self.cls.__ne__ |
326 | 329 | assert method.__doc__.strip() == ( |
327 | 330 | "Check equality and either forward a NotImplemented or\n" |
328 | | - " return the result negated." |
| 331 | + f"{indent}return the result negated." |
329 | 332 | ) |
330 | 333 | assert method.__name__ == "__ne__" |
331 | 334 |
|
@@ -393,7 +396,7 @@ def test_ne(self): |
393 | 396 | method = self.cls.__ne__ |
394 | 397 | assert method.__doc__.strip() == ( |
395 | 398 | "Check equality and either forward a NotImplemented or\n" |
396 | | - " return the result negated." |
| 399 | + f"{indent}return the result negated." |
397 | 400 | ) |
398 | 401 | assert method.__name__ == "__ne__" |
399 | 402 |
|
@@ -465,7 +468,7 @@ def test_ne(self): |
465 | 468 | method = self.cls.__ne__ |
466 | 469 | assert method.__doc__.strip() == ( |
467 | 470 | "Check equality and either forward a NotImplemented or\n" |
468 | | - " return the result negated." |
| 471 | + f"{indent}return the result negated." |
469 | 472 | ) |
470 | 473 | assert method.__name__ == "__ne__" |
471 | 474 |
|
|
0 commit comments