From 47f09000b0a47e330aa15ae74a427386590f8448 Mon Sep 17 00:00:00 2001 From: Frode Aannevik Date: Sat, 19 Nov 2022 18:16:56 +0100 Subject: [PATCH] Bump python from 3.8 to 3.10 - 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: https://github.com/pytest-dev/pytest/pull/8540 --- Dockerfile | 5 ++--- Makefile | 1 + example/test_feature.py | 11 ++++++++--- requirements.txt | 13 ++++++++++--- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2f53d06..cf11e78 100644 --- a/Dockerfile +++ b/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 diff --git a/Makefile b/Makefile index 3a47b91..137bb1f 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ build: test: @docker run \ + --rm \ -e PYTEST_ADDOPTS="$(PYTEST_ADDOPTS)" \ -v $(CURDIR)/example:/example \ -w /example $(TAG) \ diff --git a/example/test_feature.py b/example/test_feature.py index e0634b8..914ff62 100644 --- a/example/test_feature.py +++ b/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 ') -def request_ctx(url): - return dict(url=url) +def given_url(request_ctx, url): + request_ctx['url'] = url @when(parsers.parse("I request {method}")) diff --git a/requirements.txt b/requirements.txt index 494fdc7..98c3827 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 @@ -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 @@ -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