Skip to content

Commit 6802cce

Browse files
committed
Add test
1 parent 034d797 commit 6802cce

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

conftest.py renamed to tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from hypothesis import HealthCheck, settings
88

9-
from attr._compat import PY_3_10_PLUS
9+
from attr._compat import PY_3_10_PLUS, PY_3_14_PLUS
1010

1111

1212
@pytest.fixture(name="slots", params=(True, False))
@@ -34,3 +34,5 @@ def pytest_configure(config):
3434
collect_ignore = []
3535
if not PY_3_10_PLUS:
3636
collect_ignore.extend(["tests/test_pattern_matching.py"])
37+
if not PY_3_14_PLUS:
38+
collect_ignore.extend(["tests/test_forward_references.py"])

tests/test_forward_references.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""Tests for behavior specific to forward references via PEP 749."""
2+
3+
from attrs import define
4+
5+
6+
def test_forward_class_reference():
7+
"""Class A should be able to reference B even though it is defined later."""
8+
9+
@define
10+
class A:
11+
b: B
12+
13+
class B:
14+
pass

0 commit comments

Comments
 (0)