Skip to content

Commit

Permalink
Bump python from 3.8 to 3.10
Browse files Browse the repository at this point in the history
- Bump pytest from 5.3.4 to 7.2.0
- Bump pytest-bdd from 3.2.1 4.1.0

The old version of pytest/pytest-bdd did not support python3.10

Rel: pytest-dev/pytest#8540
  • Loading branch information
Frode Aannevik authored and frodeaa committed Nov 19, 2022
1 parent eecd752 commit 47f0900
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
@@ -1,8 +1,7 @@
FROM python:3.8.1-alpine3.11

COPY requirements.txt .
FROM python:3.10.8-alpine3.16

RUN apk --no-cache --update add openssl libffi
COPY requirements.txt .
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
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
13 changes: 10 additions & 3 deletions requirements.txt
Expand Up @@ -6,15 +6,19 @@ boto3==1.18.63
botocore==1.21.63
bravado-core==5.16.0
certifi==2019.11.28
cffi==1.13.2
cffi==1.15.1
chardet==3.0.4
charset-normalizer==2.0.12
colorama==0.4.1
cryptography==3.3.2
docutils==0.15.2
exceptiongroup==1.0.4
glob2==0.7
idna==2.8
importlib-metadata==1.4.0
iniconfig==1.1.1
jmespath==0.9.4
jsonpointer==2.3
jsonref==0.2
jsonschema==3.2.0
Mako==1.2.2
Expand All @@ -32,8 +36,8 @@ 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==7.2.0
pytest-bdd==4.1.0
pytest-parallel==0.1.0
python-dateutil==2.8.1
pytz==2019.3
Expand All @@ -46,6 +50,9 @@ simplejson==3.17.0
six==1.14.0
strict-rfc3339==0.7
swagger-spec-validator==2.4.3
tblib==1.7.0
tomli==2.0.1
typing_extensions==4.4.0
urllib3==1.26.5
wcwidth==0.1.8
webcolors==1.10
Expand Down

0 comments on commit 47f0900

Please sign in to comment.