Skip to content

Commit

Permalink
Merge pull request #1401 from Cito/test-py39-and-py310
Browse files Browse the repository at this point in the history
Add Python 3.9 and 3.10 to the test matrix
  • Loading branch information
syrusakbary committed Jan 11, 2022
2 parents 7ecb4e6 + e441fa7 commit 06eb1a3
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 42 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Build wheel and source tarball
run: |
pip install wheel
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
fail-fast: false
matrix:
include:
- {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}
- {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}
- {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
- {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}
- {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36}
Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
default_language_version:
python: python3.8
python: python3.9

repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-merge-conflict
- id: check-json
Expand All @@ -16,15 +16,15 @@ repos:
- --autofix
- id: trailing-whitespace
exclude: README.md
- repo: git://github.com/asottile/pyupgrade
rev: v2.24.0
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
hooks:
- id: pyupgrade
- repo: git://github.com/ambv/black
rev: 19.3b0
- repo: https://github.com/ambv/black
rev: 21.12b0
hooks:
- id: black
- repo: git://github.com/PyCQA/flake8
rev: 3.8.4
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
18 changes: 6 additions & 12 deletions graphene/types/tests/test_objecttype.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,21 +191,15 @@ def test_objecttype_as_container_all_kwargs():


def test_objecttype_as_container_extra_args():
with raises(TypeError) as excinfo:
Container("1", "2", "3")

assert "__init__() takes from 1 to 3 positional arguments but 4 were given" == str(
excinfo.value
)
msg = r"__init__\(\) takes from 1 to 3 positional arguments but 4 were given"
with raises(TypeError, match=msg):
Container("1", "2", "3") # type: ignore


def test_objecttype_as_container_invalid_kwargs():
with raises(TypeError) as excinfo:
Container(unexisting_field="3")

assert "__init__() got an unexpected keyword argument 'unexisting_field'" == str(
excinfo.value
)
msg = r"__init__\(\) got an unexpected keyword argument 'unexisting_field'"
with raises(TypeError, match=msg):
Container(unexisting_field="3") # type: ignore


def test_objecttype_container_benchmark(benchmark):
Expand Down
20 changes: 11 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ def run_tests(self):


tests_require = [
"pytest>=5.3,<6",
"pytest-benchmark>=3.2,<4",
"pytest-cov>=2.8,<3",
"pytest-mock>=2,<3",
"pytest-asyncio>=0.10,<2",
"snapshottest>=0.5,<1",
"coveralls>=1.11,<2",
"pytest>=6,<7",
"pytest-benchmark>=3.4,<4",
"pytest-cov>=3,<4",
"pytest-mock>=3,<4",
"pytest-asyncio>=0.16,<2",
"snapshottest>=0.6,<1",
"coveralls>=3.3,<4",
"promise>=2.3,<3",
"mock>=4.0,<5",
"pytz==2021.1",
"iso8601>=0.1,<2",
"pytz==2021.3",
"iso8601>=1,<2",
]

dev_requires = ["black==19.10b0", "flake8>=3.7,<4"] + tests_require
Expand All @@ -78,6 +78,8 @@ def run_tests(self):
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
keywords="api graphql protocol rest relay graphene",
packages=find_packages(exclude=["examples*"]),
Expand Down
16 changes: 8 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = flake8,py36,py37,py38,pre-commit,mypy
envlist = py3{6,7,8,9,10}, flake8, mypy, pre-commit
skipsdist = true

[testenv]
Expand All @@ -8,28 +8,28 @@ deps =
setenv =
PYTHONPATH = .:{envdir}
commands =
py{36,37,38}: pytest --cov=graphene graphene examples {posargs}
py{36,37,38,39,310}: pytest --cov=graphene graphene examples {posargs}

[testenv:pre-commit]
basepython=python3.8
basepython = python3.9
deps =
pre-commit>=2,<3
pre-commit>=2.16,<3
setenv =
LC_CTYPE=en_US.UTF-8
commands =
pre-commit run --all-files --show-diff-on-failure

[testenv:mypy]
basepython=python3.8
basepython = python3.9
deps =
mypy>=0.761,<1
mypy>=0.931,<1
commands =
mypy graphene

[testenv:flake8]
basepython=python3.8
basepython = python3.9
deps =
flake8>=3.8,<4
flake8>=4,<5
commands =
pip install --pre -e .
flake8 graphene
Expand Down

0 comments on commit 06eb1a3

Please sign in to comment.