diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 862546595b..087e7d497d 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -57,9 +57,12 @@ steps: queue: "scala" - command: - pip3 install --user tox && - cd scripts && - /var/lib/buildkite-agent/.local/bin/tox -e py3 + - cd scripts + - python3.10 + - python3 -m venv venv + - source venv/bin/activate || . venv/bin/activate + - pip3 install tox + - venv/bin/tox -vvvv -e py3 label: "Test Python scripts" - wait diff --git a/scripts/test_requirements.in b/scripts/test_requirements.in index 256d928b5d..8b71392875 100644 --- a/scripts/test_requirements.in +++ b/scripts/test_requirements.in @@ -1,4 +1,4 @@ -moto<4 +moto pytest pytest-cov coverage diff --git a/scripts/test_requirements.txt b/scripts/test_requirements.txt index 234a7c7126..9c6b978a80 100644 --- a/scripts/test_requirements.txt +++ b/scripts/test_requirements.txt @@ -1,88 +1,84 @@ # -# This file is autogenerated by pip-compile -# To update, run: +# This file is autogenerated by pip-compile with Python 3.10 +# by the following command: # # pip-compile test_requirements.in # -attrs==22.1.0 - # via pytest -boto3==1.24.59 +boto3==1.35.32 # via moto -botocore==1.27.59 +botocore==1.35.32 # via # boto3 # moto # s3transfer -certifi==2022.6.15 +certifi==2024.8.30 # via requests -cffi==1.15.1 +cffi==1.17.1 # via cryptography -charset-normalizer==2.1.1 +charset-normalizer==3.3.2 # via requests -coverage[toml]==6.4.4 +coverage[toml]==7.6.1 # via # -r test_requirements.in # pytest-cov -cryptography==37.0.4 +cryptography==43.0.1 # via moto -idna==3.3 +exceptiongroup==1.2.2 + # via pytest +idna==3.10 # via requests -iniconfig==1.1.1 +iniconfig==2.0.0 # via pytest -jinja2==3.1.2 +jinja2==3.1.4 # via moto jmespath==1.0.1 # via # boto3 # botocore -markupsafe==2.1.1 +markupsafe==2.1.5 # via # jinja2 - # moto -moto==3.1.18 + # werkzeug +moto==5.0.16 # via -r test_requirements.in -packaging==21.3 - # via pytest -pluggy==1.0.0 +packaging==24.1 # via pytest -py==1.11.0 +pluggy==1.5.0 # via pytest -pycparser==2.21 +pycparser==2.22 # via cffi -pyparsing==3.0.9 - # via packaging -pytest-cov==3.0.0 - # via -r test_requirements.in -pytest==7.1.2 +pytest==8.3.3 # via # -r test_requirements.in # pytest-cov -python-dateutil==2.8.2 +pytest-cov==5.0.0 + # via -r test_requirements.in +python-dateutil==2.9.0.post0 # via # botocore # moto -pytz==2022.2.1 - # via moto -requests==2.28.1 +pyyaml==6.0.2 + # via responses +requests==2.32.3 # via # moto # responses -responses==0.21.0 +responses==0.25.3 # via moto -s3transfer==0.6.0 +s3transfer==0.10.2 # via boto3 six==1.16.0 # via python-dateutil -tomli==2.0.1 +tomli==2.0.2 # via # coverage # pytest -urllib3==1.26.12 +urllib3==2.2.3 # via # botocore # requests # responses -werkzeug==2.1.2 +werkzeug==3.0.4 # via moto xmltodict==0.13.0 # via moto diff --git a/scripts/tests/test_dynamo.py b/scripts/tests/test_dynamo.py index 181e45abed..d6c980880a 100644 --- a/scripts/tests/test_dynamo.py +++ b/scripts/tests/test_dynamo.py @@ -9,7 +9,7 @@ @pytest.fixture def client(): - with moto.mock_dynamodb2(): + with moto.mock_aws(): yield boto3.resource("dynamodb", region_name="eu-west-1").meta.client diff --git a/scripts/tests/test_s3.py b/scripts/tests/test_s3.py index cba0a8529f..663bb37afc 100644 --- a/scripts/tests/test_s3.py +++ b/scripts/tests/test_s3.py @@ -7,7 +7,7 @@ @pytest.fixture def client(): - with moto.mock_s3(): + with moto.mock_aws(): yield boto3.client("s3", region_name="us-east-1") diff --git a/scripts/tests/test_secrets.py b/scripts/tests/test_secrets.py index 4be73fd202..2973e771e9 100644 --- a/scripts/tests/test_secrets.py +++ b/scripts/tests/test_secrets.py @@ -7,7 +7,7 @@ @pytest.fixture def client(): - with moto.mock_secretsmanager(): + with moto.mock_aws(): yield boto3.client("secretsmanager", region_name="eu-west-1") diff --git a/scripts/tox.ini b/scripts/tox.ini index 40eb4b6d19..852516b6c4 100644 --- a/scripts/tox.ini +++ b/scripts/tox.ini @@ -3,8 +3,9 @@ envlist = py3 skipsdist = True [testenv] +basepython = python3.10 deps = -r{toxinidir}/test_requirements.txt commands = - coverage run -m py.test tests + coverage run -m pytest tests coverage report