Skip to content

Commit 06eb1a3

Browse files
authored
Merge pull request #1401 from Cito/test-py39-and-py310
Add Python 3.9 and 3.10 to the test matrix
2 parents 7ecb4e6 + e441fa7 commit 06eb1a3

File tree

7 files changed

+40
-42
lines changed

7 files changed

+40
-42
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v2
14-
- name: Set up Python 3.8
14+
- name: Set up Python 3.9
1515
uses: actions/setup-python@v2
1616
with:
17-
python-version: 3.8
17+
python-version: 3.9
1818
- name: Build wheel and source tarball
1919
run: |
2020
pip install wheel

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88

99
steps:
1010
- uses: actions/checkout@v2
11-
- name: Set up Python 3.8
11+
- name: Set up Python 3.9
1212
uses: actions/setup-python@v2
1313
with:
14-
python-version: 3.8
14+
python-version: 3.9
1515
- name: Install dependencies
1616
run: |
1717
python -m pip install --upgrade pip

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
include:
28+
- {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}
29+
- {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}
2830
- {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
2931
- {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}
3032
- {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36}

.pre-commit-config.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
default_language_version:
2-
python: python3.8
2+
python: python3.9
33

44
repos:
5-
- repo: git://github.com/pre-commit/pre-commit-hooks
6-
rev: v2.3.0
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v4.1.0
77
hooks:
88
- id: check-merge-conflict
99
- id: check-json
@@ -16,15 +16,15 @@ repos:
1616
- --autofix
1717
- id: trailing-whitespace
1818
exclude: README.md
19-
- repo: git://github.com/asottile/pyupgrade
20-
rev: v2.24.0
19+
- repo: https://github.com/asottile/pyupgrade
20+
rev: v2.31.0
2121
hooks:
2222
- id: pyupgrade
23-
- repo: git://github.com/ambv/black
24-
rev: 19.3b0
23+
- repo: https://github.com/ambv/black
24+
rev: 21.12b0
2525
hooks:
2626
- id: black
27-
- repo: git://github.com/PyCQA/flake8
28-
rev: 3.8.4
27+
- repo: https://github.com/PyCQA/flake8
28+
rev: 4.0.1
2929
hooks:
3030
- id: flake8

graphene/types/tests/test_objecttype.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -191,21 +191,15 @@ def test_objecttype_as_container_all_kwargs():
191191

192192

193193
def test_objecttype_as_container_extra_args():
194-
with raises(TypeError) as excinfo:
195-
Container("1", "2", "3")
196-
197-
assert "__init__() takes from 1 to 3 positional arguments but 4 were given" == str(
198-
excinfo.value
199-
)
194+
msg = r"__init__\(\) takes from 1 to 3 positional arguments but 4 were given"
195+
with raises(TypeError, match=msg):
196+
Container("1", "2", "3") # type: ignore
200197

201198

202199
def test_objecttype_as_container_invalid_kwargs():
203-
with raises(TypeError) as excinfo:
204-
Container(unexisting_field="3")
205-
206-
assert "__init__() got an unexpected keyword argument 'unexisting_field'" == str(
207-
excinfo.value
208-
)
200+
msg = r"__init__\(\) got an unexpected keyword argument 'unexisting_field'"
201+
with raises(TypeError, match=msg):
202+
Container(unexisting_field="3") # type: ignore
209203

210204

211205
def test_objecttype_container_benchmark(benchmark):

setup.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ def run_tests(self):
4545

4646

4747
tests_require = [
48-
"pytest>=5.3,<6",
49-
"pytest-benchmark>=3.2,<4",
50-
"pytest-cov>=2.8,<3",
51-
"pytest-mock>=2,<3",
52-
"pytest-asyncio>=0.10,<2",
53-
"snapshottest>=0.5,<1",
54-
"coveralls>=1.11,<2",
48+
"pytest>=6,<7",
49+
"pytest-benchmark>=3.4,<4",
50+
"pytest-cov>=3,<4",
51+
"pytest-mock>=3,<4",
52+
"pytest-asyncio>=0.16,<2",
53+
"snapshottest>=0.6,<1",
54+
"coveralls>=3.3,<4",
5555
"promise>=2.3,<3",
5656
"mock>=4.0,<5",
57-
"pytz==2021.1",
58-
"iso8601>=0.1,<2",
57+
"pytz==2021.3",
58+
"iso8601>=1,<2",
5959
]
6060

6161
dev_requires = ["black==19.10b0", "flake8>=3.7,<4"] + tests_require
@@ -78,6 +78,8 @@ def run_tests(self):
7878
"Programming Language :: Python :: 3.6",
7979
"Programming Language :: Python :: 3.7",
8080
"Programming Language :: Python :: 3.8",
81+
"Programming Language :: Python :: 3.9",
82+
"Programming Language :: Python :: 3.10",
8183
],
8284
keywords="api graphql protocol rest relay graphene",
8385
packages=find_packages(exclude=["examples*"]),

tox.ini

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = flake8,py36,py37,py38,pre-commit,mypy
2+
envlist = py3{6,7,8,9,10}, flake8, mypy, pre-commit
33
skipsdist = true
44

55
[testenv]
@@ -8,28 +8,28 @@ deps =
88
setenv =
99
PYTHONPATH = .:{envdir}
1010
commands =
11-
py{36,37,38}: pytest --cov=graphene graphene examples {posargs}
11+
py{36,37,38,39,310}: pytest --cov=graphene graphene examples {posargs}
1212

1313
[testenv:pre-commit]
14-
basepython=python3.8
14+
basepython = python3.9
1515
deps =
16-
pre-commit>=2,<3
16+
pre-commit>=2.16,<3
1717
setenv =
1818
LC_CTYPE=en_US.UTF-8
1919
commands =
2020
pre-commit run --all-files --show-diff-on-failure
2121

2222
[testenv:mypy]
23-
basepython=python3.8
23+
basepython = python3.9
2424
deps =
25-
mypy>=0.761,<1
25+
mypy>=0.931,<1
2626
commands =
2727
mypy graphene
2828

2929
[testenv:flake8]
30-
basepython=python3.8
30+
basepython = python3.9
3131
deps =
32-
flake8>=3.8,<4
32+
flake8>=4,<5
3333
commands =
3434
pip install --pre -e .
3535
flake8 graphene

0 commit comments

Comments
 (0)