Skip to content

Commit b65c972

Browse files
authored
Merge pull request #330 from ashb/upgrade-pytest
Update pytest to latest version
2 parents b801118 + f08a38b commit b65c972

File tree

9 files changed

+115
-70
lines changed

9 files changed

+115
-70
lines changed

poetry.lock

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
[build-system]
2+
requires = ["poetry-core>=1.0.0"]
3+
build-backend = "poetry.core.masonry.api"
4+
5+
[tool.coverage.run]
6+
branch = true
7+
source =["openapi_core"]
8+
9+
[tool.coverage.xml]
10+
output = "reports/coverage.xml"
11+
112
[tool.poetry]
213
name = "openapi-core"
314
version = "0.14.2"
@@ -22,7 +33,7 @@ classifiers = [
2233
]
2334

2435
[tool.poetry.dependencies]
25-
python = ">=3.6"
36+
python = "^3.6"
2637
dataclasses = {version = "*", python = "~3.6"}
2738
dictpath = "*"
2839
django = {version = ">=3.0", optional = true}
@@ -48,7 +59,7 @@ djangorestframework = "^3.11.2"
4859
falcon = ">=3.0"
4960
flask = "*"
5061
pre-commit = "*"
51-
pytest = "^5.0.0"
62+
pytest = "^6"
5263
pytest-flake8 = "*"
5364
pytest-cov = "*"
5465
responses = "*"
@@ -57,6 +68,14 @@ sphinx-rtd-theme = "^0.5.2"
5768
strict-rfc3339 = "^0.7"
5869
webob = "*"
5970

60-
[build-system]
61-
requires = ["poetry-core>=1.0.0"]
62-
build-backend = "poetry.core.masonry.api"
71+
[tool.pytest.ini_options]
72+
addopts = """
73+
--capture=no
74+
--verbose
75+
--pythonwarnings=error
76+
--showlocals
77+
--junitxml=reports/junit.xml
78+
--cov=openapi_core
79+
--cov-report=term-missing
80+
--cov-report=xml
81+
"""

setup.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/integration/contrib/django/test_django_project.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ def test_get_no_required_param(self, client):
4646
'HTTP_AUTHORIZATION': 'Basic testuser',
4747
'HTTP_HOST': 'petstore.swagger.io',
4848
}
49-
response = client.get('/v1/pets', **headers)
49+
50+
with pytest.warns(DeprecationWarning):
51+
response = client.get('/v1/pets', **headers)
5052

5153
expected_data = {
5254
'errors': [
@@ -71,7 +73,9 @@ def test_get_valid(self, client):
7173
'HTTP_AUTHORIZATION': 'Basic testuser',
7274
'HTTP_HOST': 'petstore.swagger.io',
7375
}
74-
response = client.get('/v1/pets', data_json, **headers)
76+
77+
with pytest.warns(DeprecationWarning):
78+
response = client.get('/v1/pets', data_json, **headers)
7579

7680
expected_data = {
7781
'data': [

tests/integration/contrib/falcon/test_falcon_project.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from json import dumps
33

44
from falcon.constants import MEDIA_URLENCODED
5+
import pytest
56

67

78
class BaseTestFalconProject:
@@ -22,8 +23,9 @@ def test_get_no_required_param(self, client):
2223
'Content-Type': 'application/json',
2324
}
2425

25-
response = client.simulate_get(
26-
'/v1/pets', host='petstore.swagger.io', headers=headers)
26+
with pytest.warns(DeprecationWarning):
27+
response = client.simulate_get(
28+
'/v1/pets', host='petstore.swagger.io', headers=headers)
2729

2830
assert response.status_code == 400
2931

@@ -33,11 +35,12 @@ def test_get_valid(self, client):
3335
}
3436
query_string = "limit=12"
3537

36-
response = client.simulate_get(
37-
'/v1/pets',
38-
host='petstore.swagger.io', headers=headers,
39-
query_string=query_string,
40-
)
38+
with pytest.warns(DeprecationWarning):
39+
response = client.simulate_get(
40+
'/v1/pets',
41+
host='petstore.swagger.io', headers=headers,
42+
query_string=query_string,
43+
)
4144

4245
assert response.status_code == 200
4346
assert response.json == {

0 commit comments

Comments
 (0)