Skip to content

Commit e79b0a7

Browse files
committed
Move 3.6-syntaxed test to test_next_gen.py
1 parent 9ef5ff7 commit e79b0a7

File tree

2 files changed

+35
-36
lines changed

2 files changed

+35
-36
lines changed

tests/test_make.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import attr
2222

2323
from attr import _config
24-
from attr._compat import PY2, PY36, PY310, ordered_dict
24+
from attr._compat import PY2, PY310, ordered_dict
2525
from attr._make import (
2626
Attribute,
2727
Factory,
@@ -429,41 +429,6 @@ class D(B, C):
429429

430430
assert d.x == d.xx()
431431

432-
@pytest.mark.skipif(not PY36, reason="NG is 3.6+-only")
433-
def test_mro_ng(self):
434-
"""
435-
Attributes and methods are looked up the same way in NG by default.
436-
437-
See #428
438-
"""
439-
440-
@attr.define
441-
class A:
442-
443-
x: int = 10
444-
445-
def xx(self):
446-
return 10
447-
448-
@attr.define
449-
class B(A):
450-
y: int = 20
451-
452-
@attr.define
453-
class C(A):
454-
x: int = 50
455-
456-
def xx(self):
457-
return 50
458-
459-
@attr.define
460-
class D(B, C):
461-
pass
462-
463-
d = D()
464-
465-
assert d.x == d.xx()
466-
467432
def test_inherited(self):
468433
"""
469434
Inherited Attributes have `.inherited` True, otherwise False.

tests/test_next_gen.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,37 @@ def _v(self, _, value):
333333
# Validates
334334
with pytest.raises(ValueError, match="must be >=10"):
335335
inst.x = "9"
336+
337+
def test_mro_ng(self):
338+
"""
339+
Attributes and methods are looked up the same way in NG by default.
340+
341+
See #428
342+
"""
343+
344+
@attr.define
345+
class A:
346+
347+
x: int = 10
348+
349+
def xx(self):
350+
return 10
351+
352+
@attr.define
353+
class B(A):
354+
y: int = 20
355+
356+
@attr.define
357+
class C(A):
358+
x: int = 50
359+
360+
def xx(self):
361+
return 50
362+
363+
@attr.define
364+
class D(B, C):
365+
pass
366+
367+
d = D()
368+
369+
assert d.x == d.xx()

0 commit comments

Comments
 (0)