Skip to content

Commit

Permalink
Test on 3.12 (strawberry-graphql#2958)
Browse files Browse the repository at this point in the history
* Test on 3.12

* Better warnings filters

* update lock file
  • Loading branch information
patrick91 authored and etripier committed Oct 25, 2023
1 parent 65e70b4 commit 8b0e76f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- uses: actions/checkout@v3
- uses: wntrblm/nox@main
with:
python-versions: "3.8, 3.9, 3.10, 3.11"
python-versions: "3.8, 3.9, 3.10, 3.11, 3.12"

- name: Pip and nox cache
id: cache
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
- uses: actions/checkout@v3
- uses: wntrblm/nox@main
with:
python-versions: "3.7, 3.8, 3.9, 3.10, 3.11"
python-versions: "3.8, 3.9, 3.10, 3.11, 3.12"

- name: Pip and nox cache
id: cache
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
nox.options.reuse_existing_virtualenvs = True
nox.options.error_on_external_run = True

PYTHON_VERSIONS = ["3.11", "3.10", "3.9", "3.8"]
PYTHON_VERSIONS = ["3.12", "3.11", "3.10", "3.9", "3.8"]


COMMON_PYTEST_OPTIONS = [
Expand Down
8 changes: 7 additions & 1 deletion tests/federation/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,15 @@ def top_products(self, first: int) -> List[ProductFed]:
return []

with warnings.catch_warnings(record=True) as w:
warnings.filterwarnings(
"ignore",
category=DeprecationWarning,
message=r"'.*' is deprecated and slated for removal in Python 3\.\d+",
)

strawberry.federation.Schema(
query=Query,
enable_federation_2=True,
)

assert not w
assert len(w) == 0
15 changes: 15 additions & 0 deletions tests/schema/extensions/test_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,11 @@ def on_executing_start(self):

async def test_legacy_extension_supported():
with warnings.catch_warnings(record=True) as w:
warnings.filterwarnings(
"ignore",
category=DeprecationWarning,
message=r"'.*' is deprecated and slated for removal in Python 3\.\d+",
)

class CompatExtension(ExampleExtension):
async def on_request_start(self):
Expand Down Expand Up @@ -521,6 +526,11 @@ def person(self) -> Person:

async def test_legacy_only_start():
with warnings.catch_warnings(record=True) as w:
warnings.filterwarnings(
"ignore",
category=DeprecationWarning,
message=r"'.*' is deprecated and slated for removal in Python 3\.\d+",
)

class CompatExtension(ExampleExtension):
expected = {1, 2, 3, 4}
Expand Down Expand Up @@ -559,6 +569,11 @@ def person(self) -> Person:

async def test_legacy_only_end():
with warnings.catch_warnings(record=True) as w:
warnings.filterwarnings(
"ignore",
category=DeprecationWarning,
message=r"'.*' is deprecated and slated for removal in Python 3\.\d+",
)

class CompatExtension(ExampleExtension):
async def on_request_end(self):
Expand Down

0 comments on commit 8b0e76f

Please sign in to comment.