Skip to content

Commit

Permalink
Bump python from 3.8 to 3.10 (#4)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
frodeaa committed Nov 20, 2022
1 parent eecd752 commit 23c5712
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 56 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
@@ -1,8 +1,7 @@
FROM python:3.8.1-alpine3.11
FROM python:3.10.8-alpine3.16

RUN apk --no-cache --update add openssl libffi patch
COPY requirements.txt .

RUN apk --no-cache --update add openssl libffi
RUN apk --no-cache --update add --virtual build-dependencies build-base libffi-dev openssl-dev \
&& pty=False python3 -m pip install --disable-pip-version-check -r requirements.txt \
&& apk del build-dependencies
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -7,6 +7,7 @@ build:

test:
@docker run \
--rm \
-e PYTEST_ADDOPTS="$(PYTEST_ADDOPTS)" \
-v $(CURDIR)/example:/example \
-w /example $(TAG) \
Expand Down
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -41,8 +41,14 @@ run with volume mount
The docker image installs many useful libraries
for testing REST APIs with pytest-bdd.

- boto3
- [bravado_core]: support for the OpenAPI Specification v2.0. (Swagger 2)
- cryptography
- pytcodestyle
- [PyJWT]: JSON Web Token implementation in Python
- pytest-bdd
- pytest-parallel
- pytest
- [Requests]: HTTP for Humans

See the [requirements.txt] for complete list of libraries installed by the [Dockerfile].
Expand Down
11 changes: 8 additions & 3 deletions example/test_feature.py
@@ -1,13 +1,18 @@
import requests

from pytest import fixture
from pytest_bdd import (
scenarios, given, when, then, parsers
)


@fixture
def request_ctx():
return dict()


@given('a <url>')
def request_ctx(url):
return dict(url=url)
def given_url(request_ctx, url):
request_ctx['url'] = url


@when(parsers.parse("I request {method}"))
Expand Down
99 changes: 49 additions & 50 deletions requirements.txt
@@ -1,52 +1,51 @@
asn1crypto==1.3.0
atomicwrites==1.3.0
attrs==19.3.0
awscli==1.20.63
boto3==1.18.63
botocore==1.21.63
bravado-core==5.16.0
certifi==2019.11.28
cffi==1.13.2
chardet==3.0.4
colorama==0.4.1
cryptography==3.3.2
docutils==0.15.2
arrow==1.2.3
attrs==22.1.0
boto3==1.26.13
botocore==1.29.13
bravado-core==5.17.1
certifi==2022.9.24
cffi==1.15.1
charset-normalizer==2.1.1
cryptography==38.0.3
exceptiongroup==1.0.4
fqdn==1.5.1
glob2==0.7
idna==2.8
importlib-metadata==1.4.0
jmespath==0.9.4
jsonref==0.2
jsonschema==3.2.0
Mako==1.2.2
MarkupSafe==1.1.1
more-itertools==8.1.0
msgpack-python==0.5.6
packaging==20.1
parse==1.14.0
parse-type==0.5.2
pluggy==0.13.1
py==1.10.0
pyasn1==0.4.8
pycodestyle==2.5.0
pycparser==2.19
PyJWT==2.4.0
pyparsing==2.4.6
pyrsistent==0.15.7
pytest==5.3.4
pytest-bdd==3.2.1
pytest-parallel==0.1.0
python-dateutil==2.8.1
pytz==2019.3
PyYAML==5.4
requests==2.26.0
idna==3.4
iniconfig==1.1.1
isoduration==20.11.0
jmespath==1.0.1
jsonpointer==2.3
jsonref==1.0.1
jsonschema==4.17.0
Mako==1.2.4
MarkupSafe==2.1.1
msgpack==1.0.4
packaging==21.3
parse==1.19.0
parse-type==0.6.0
pluggy==1.0.0
py==1.11.0
pycodestyle==2.9.1
pycparser==2.21
PyJWT==2.6.0
pyparsing==3.0.9
pyrsistent==0.19.2
pytest==7.2.0
pytest-bdd==4.1.0
pytest-parallel==0.1.1
python-dateutil==2.8.2
pytz==2022.6
PyYAML==6.0
requests==2.28.1
rfc3339-validator==0.1.4
rfc3987==1.3.8
rsa==4.7
s3transfer==0.5.0
simplejson==3.17.0
six==1.14.0
strict-rfc3339==0.7
swagger-spec-validator==2.4.3
urllib3==1.26.5
wcwidth==0.1.8
webcolors==1.10
zipp==2.0.1
s3transfer==0.6.0
simplejson==3.18.0
six==1.16.0
swagger-spec-validator==3.0.3
tblib==1.7.0
tomli==2.0.1
typing_extensions==4.4.0
uri-template==1.2.0
urllib3==1.26.12
webcolors==1.12

0 comments on commit 23c5712

Please sign in to comment.