Skip to content

Commit 2b09265

Browse files
authored
Merge pull request #359 from jacebrowning/remove-pep-563
Remove test handling for PEP 563
2 parents 5f2962d + 9bc9b7c commit 2b09265

File tree

11 files changed

+5
-33
lines changed

11 files changed

+5
-33
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
# TODO: Add 3.12 and 3.13 when dev dependencies support it
12-
python-version: ['3.9', '3.10', '3.11']
11+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
1312

1413
steps:
1514
- uses: actions/checkout@v2

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ classifiers = [
3535
"Programming Language :: Python :: 3.10",
3636
"Programming Language :: Python :: 3.11",
3737
"Programming Language :: Python :: 3.12",
38+
"Programming Language :: Python :: 3.13",
3839
"Programming Language :: Python",
3940
"Topic :: Software Development",
4041
"Topic :: Utilities",

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ addopts =
1111
--cov-report=term-missing:skip-covered
1212
--no-cov-on-fail
1313

14+
xfail_strict = true
15+
1416
cache_dir = .cache
1517

1618
log_level = DEBUG

tests/__init__.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1 @@
11
"""Integration tests for the package."""
2-
3-
import sys
4-
5-
import pytest
6-
7-
xfail_with_pep_563 = pytest.mark.xfail(
8-
sys.version_info >= (3, 12),
9-
reason="Postponed evaluations (PEP 563) are unable to resolve locally-defined types",
10-
)

tests/test_generic_converters.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
from datafiles import Missing, converters, datafile
66
from datafiles.utils import dedent
77

8-
from . import xfail_with_pep_563
98

10-
11-
@xfail_with_pep_563
129
def test_generic_converters(expect):
1310
S = TypeVar("S")
1411
T = TypeVar("T")

tests/test_instantiation.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
from datafiles import Missing, datafile
99
from datafiles.utils import logbreak, write
1010

11-
from . import xfail_with_pep_563
12-
1311
counter = 0
1412

1513

@@ -178,7 +176,6 @@ class Sample:
178176

179177

180178
def describe_missing_attributes():
181-
@xfail_with_pep_563
182179
def when_dataclass(expect):
183180
@dataclass
184181
class Name:

tests/test_loading.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from datafiles import Missing, datafile
1010
from datafiles.utils import dedent, logbreak, read, write
1111

12-
from . import xfail_with_pep_563
1312
from .samples import (
1413
Sample,
1514
SampleAsJSON,
@@ -279,7 +278,6 @@ def with_extra_attributes(sample, expect):
279278
expect(sample.nested.score) == 3.4
280279
expect(hasattr(sample.nested, "extra")).is_(False)
281280

282-
@xfail_with_pep_563
283281
def with_multiple_levels(expect):
284282
@dataclass
285283
class Bottom:

tests/test_orm_usage.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from datafiles import datafile
99
from datafiles.utils import logbreak, write
1010

11-
from . import xfail_with_pep_563
1211
from .samples import SampleWithNestingAndOptionals
1312

1413

@@ -51,7 +50,6 @@ def test_multiple_instances_are_distinct(expect):
5150
}
5251

5352

54-
@xfail_with_pep_563
5553
def test_classes_can_share_a_nested_dataclass(expect):
5654
@datafile
5755
class Nested:
@@ -117,7 +115,6 @@ def test_partial_nested_load_from_disk(expect):
117115
expect(items[0].nested.weight).is_(None)
118116

119117

120-
@xfail_with_pep_563
121118
def test_missing_optional_fields_are_loaded(expect):
122119
@datafile
123120
class Name:

tests/test_profiling.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
from datafiles import datafile
77
from datafiles.utils import logbreak
88

9-
from . import xfail_with_pep_563
10-
119

1210
def get_sample():
1311
@dataclass
@@ -31,19 +29,16 @@ class Sample:
3129
return Sample("profiling", Item(2, None), None, [Item(3, None)])
3230

3331

34-
@xfail_with_pep_563
3532
def test_init():
3633
get_sample()
3734

3835

39-
@xfail_with_pep_563
4036
def test_load():
4137
sample = get_sample()
4238
logbreak("Loading")
4339
sample.datafile.load() # pylint: disable=no-member
4440

4541

46-
@xfail_with_pep_563
4742
def test_save():
4843
sample = get_sample()
4944
logbreak("Saving")

tests/test_saving.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from datafiles import datafile
1111
from datafiles.utils import dedent, logbreak, read, write
1212

13-
from . import xfail_with_pep_563
1413
from .samples import (
1514
Sample,
1615
SampleFrozen,
@@ -295,7 +294,6 @@ def with_nones(expect):
295294
"""
296295
)
297296

298-
@xfail_with_pep_563
299297
def when_nested_dataclass_is_none(expect):
300298
@datafile
301299
class Name:

0 commit comments

Comments
 (0)