Skip to content

Commit 23c5712

Browse files
authored
Bump python from 3.8 to 3.10 (#4)
Bump pytest and pytes-bdd to get support for python3.10 - pytest from 5.3.4 to 7.2.0 - pytest-bdd from 3.2.1 to 4.1.0 (5 and 6 have to many breaking changes) See: https://github.com/pytest-dev/pytest-bdd/blob/master/CHANGES.rst Bump other dependencies - boto3 - bravado-core - cryptography - pycodestyle - PyJWT - pytest-parallel - requests The `requirements.txt` was updated wit the output from `pip freeze` after new version of the dependencies was installed Rel: pytest-dev/pytest#8540
1 parent eecd752 commit 23c5712

File tree

5 files changed

+66
-56
lines changed

5 files changed

+66
-56
lines changed

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
FROM python:3.8.1-alpine3.11
1+
FROM python:3.10.8-alpine3.16
22

3+
RUN apk --no-cache --update add openssl libffi patch
34
COPY requirements.txt .
4-
5-
RUN apk --no-cache --update add openssl libffi
65
RUN apk --no-cache --update add --virtual build-dependencies build-base libffi-dev openssl-dev \
76
&& pty=False python3 -m pip install --disable-pip-version-check -r requirements.txt \
87
&& apk del build-dependencies

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ build:
77

88
test:
99
@docker run \
10+
--rm \
1011
-e PYTEST_ADDOPTS="$(PYTEST_ADDOPTS)" \
1112
-v $(CURDIR)/example:/example \
1213
-w /example $(TAG) \

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,14 @@ run with volume mount
4141
The docker image installs many useful libraries
4242
for testing REST APIs with pytest-bdd.
4343

44+
- boto3
4445
- [bravado_core]: support for the OpenAPI Specification v2.0. (Swagger 2)
46+
- cryptography
47+
- pytcodestyle
4548
- [PyJWT]: JSON Web Token implementation in Python
49+
- pytest-bdd
50+
- pytest-parallel
51+
- pytest
4652
- [Requests]: HTTP for Humans
4753

4854
See the [requirements.txt] for complete list of libraries installed by the [Dockerfile].

example/test_feature.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
import requests
2-
2+
from pytest import fixture
33
from pytest_bdd import (
44
scenarios, given, when, then, parsers
55
)
66

77

8+
@fixture
9+
def request_ctx():
10+
return dict()
11+
12+
813
@given('a <url>')
9-
def request_ctx(url):
10-
return dict(url=url)
14+
def given_url(request_ctx, url):
15+
request_ctx['url'] = url
1116

1217

1318
@when(parsers.parse("I request {method}"))

requirements.txt

Lines changed: 49 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,51 @@
1-
asn1crypto==1.3.0
2-
atomicwrites==1.3.0
3-
attrs==19.3.0
4-
awscli==1.20.63
5-
boto3==1.18.63
6-
botocore==1.21.63
7-
bravado-core==5.16.0
8-
certifi==2019.11.28
9-
cffi==1.13.2
10-
chardet==3.0.4
11-
colorama==0.4.1
12-
cryptography==3.3.2
13-
docutils==0.15.2
1+
arrow==1.2.3
2+
attrs==22.1.0
3+
boto3==1.26.13
4+
botocore==1.29.13
5+
bravado-core==5.17.1
6+
certifi==2022.9.24
7+
cffi==1.15.1
8+
charset-normalizer==2.1.1
9+
cryptography==38.0.3
10+
exceptiongroup==1.0.4
11+
fqdn==1.5.1
1412
glob2==0.7
15-
idna==2.8
16-
importlib-metadata==1.4.0
17-
jmespath==0.9.4
18-
jsonref==0.2
19-
jsonschema==3.2.0
20-
Mako==1.2.2
21-
MarkupSafe==1.1.1
22-
more-itertools==8.1.0
23-
msgpack-python==0.5.6
24-
packaging==20.1
25-
parse==1.14.0
26-
parse-type==0.5.2
27-
pluggy==0.13.1
28-
py==1.10.0
29-
pyasn1==0.4.8
30-
pycodestyle==2.5.0
31-
pycparser==2.19
32-
PyJWT==2.4.0
33-
pyparsing==2.4.6
34-
pyrsistent==0.15.7
35-
pytest==5.3.4
36-
pytest-bdd==3.2.1
37-
pytest-parallel==0.1.0
38-
python-dateutil==2.8.1
39-
pytz==2019.3
40-
PyYAML==5.4
41-
requests==2.26.0
13+
idna==3.4
14+
iniconfig==1.1.1
15+
isoduration==20.11.0
16+
jmespath==1.0.1
17+
jsonpointer==2.3
18+
jsonref==1.0.1
19+
jsonschema==4.17.0
20+
Mako==1.2.4
21+
MarkupSafe==2.1.1
22+
msgpack==1.0.4
23+
packaging==21.3
24+
parse==1.19.0
25+
parse-type==0.6.0
26+
pluggy==1.0.0
27+
py==1.11.0
28+
pycodestyle==2.9.1
29+
pycparser==2.21
30+
PyJWT==2.6.0
31+
pyparsing==3.0.9
32+
pyrsistent==0.19.2
33+
pytest==7.2.0
34+
pytest-bdd==4.1.0
35+
pytest-parallel==0.1.1
36+
python-dateutil==2.8.2
37+
pytz==2022.6
38+
PyYAML==6.0
39+
requests==2.28.1
40+
rfc3339-validator==0.1.4
4241
rfc3987==1.3.8
43-
rsa==4.7
44-
s3transfer==0.5.0
45-
simplejson==3.17.0
46-
six==1.14.0
47-
strict-rfc3339==0.7
48-
swagger-spec-validator==2.4.3
49-
urllib3==1.26.5
50-
wcwidth==0.1.8
51-
webcolors==1.10
52-
zipp==2.0.1
42+
s3transfer==0.6.0
43+
simplejson==3.18.0
44+
six==1.16.0
45+
swagger-spec-validator==3.0.3
46+
tblib==1.7.0
47+
tomli==2.0.1
48+
typing_extensions==4.4.0
49+
uri-template==1.2.0
50+
urllib3==1.26.12
51+
webcolors==1.12

0 commit comments

Comments
 (0)