diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ecd6334..5337c11 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,11 +8,11 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: - python-version: "3.10" + python-version: "3.14" - name: Lint code run: | make setup @@ -29,9 +29,9 @@ jobs: python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ matrix.python-version }} - name: Run tests @@ -49,9 +49,9 @@ jobs: id-token: write # IMPORTANT: mandatory for trusted publishing timeout-minutes: 10 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: 3.11 - name: Install pypa/build @@ -66,7 +66,7 @@ jobs: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && github.actor == github.repository_owner - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: python-package-distributions path: dist/ @@ -75,4 +75,4 @@ jobs: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && github.actor == github.repository_owner - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 diff --git a/Makefile b/Makefile index baa2974..8fc2cb8 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,10 @@ setup: pip install -r requirements-dev.txt format: - black pytest_httpdbg tests + black pytest_httpdbg tests --target-version py39 lint: - black --check pytest_httpdbg tests + black --check pytest_httpdbg tests --target-version py39 flake8 pytest_httpdbg tests check: lint diff --git a/pytest_httpdbg/__init__.py b/pytest_httpdbg/__init__.py index eba8fe7..f276635 100644 --- a/pytest_httpdbg/__init__.py +++ b/pytest_httpdbg/__init__.py @@ -1,3 +1,3 @@ from pytest_httpdbg.plugin import httpdbg_record_filename # noqa F401 -__version__ = "0.10.1" +__version__ = "0.10.2" diff --git a/tests/test_allure.py b/tests/test_allure.py index 4b152d1..a9efaf3 100644 --- a/tests/test_allure.py +++ b/tests/test_allure.py @@ -2,7 +2,6 @@ import pytest - confest_py = """ import pytest import requests @@ -26,14 +25,12 @@ def fixture_function(httpbin, fixture_session): def test_mode_mutual_exclusion(pytester): pytester.makeconftest(confest_py) - pytester.makepyfile( - """ + pytester.makepyfile(""" import requests def test_get(httpbin, fixture_session, fixture_function): requests.get(httpbin.url + "/get") - """ - ) + """) result = pytester.runpytest("--httpdbg", "--httpdbg-allure") @@ -49,8 +46,7 @@ def test_get(httpbin, fixture_session, fixture_function): def test_mode_allure(pytester, tmp_path): pytester.makeconftest(confest_py) - pytester.makepyfile( - """ + pytester.makepyfile(""" import requests def test_get(httpbin, fixture_session, fixture_function): @@ -58,8 +54,7 @@ def test_get(httpbin, fixture_session, fixture_function): def test_post(httpbin, fixture_session, fixture_function): requests.post(httpbin.url + "/post", json={"a":"b"}) - """ - ) + """) result = pytester.runpytest("--httpdbg-allure", f"--alluredir={tmp_path}") @@ -92,8 +87,7 @@ def test_post(httpbin, fixture_session, fixture_function): def test_mode_allure_only_on_failure(pytester, tmp_path): pytester.makeconftest(confest_py) - pytester.makepyfile( - """ + pytester.makepyfile(""" import requests def test_pass(httpbin): @@ -102,8 +96,7 @@ def test_pass(httpbin): def test_fail(httpbin): requests.post(httpbin.url + "/post", json={"a":"b"}) assert False - """ - ) + """) result = pytester.runpytest( "--httpdbg-allure", f"--alluredir={tmp_path}", "--httpdbg-only-on-failure" diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 0aaf97d..749885a 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -29,8 +29,7 @@ def fixture_function(httpbin, fixture_session): def test_no_httpdbg(pytester): pytester.makeconftest(confest_py) - pytester.makepyfile( - """ + pytester.makepyfile(""" import requests def test_get(httpbin, fixture_session, fixture_function): @@ -38,8 +37,7 @@ def test_get(httpbin, fixture_session, fixture_function): def test_post(httpbin, fixture_session): requests.post(httpbin.url + "/intest") - """ - ) + """) result = pytester.runpytest() @@ -52,8 +50,7 @@ def test_record_in_dir(pytester, tmp_path): pytester.makeconftest(confest_py) - pytester.makepyfile( - """ + pytester.makepyfile(""" import requests def test_get(httpbin, fixture_session, fixture_function): @@ -61,8 +58,7 @@ def test_get(httpbin, fixture_session, fixture_function): def test_post(httpbin, fixture_session): requests.post(httpbin.url + "/intest") - """ - ) + """) result = pytester.runpytest("--httpdbg", "--httpdbg-dir", str(logs_dir)) @@ -87,14 +83,12 @@ def test_with_initiator(pytester, tmp_path): ".py", fakepackage="import requests\ndef coucou(url):\n requests.get(url)\n" ) - pytester.makepyfile( - """ + pytester.makepyfile(""" import fakepackage def test_with_initiator_fake(httpbin): fakepackage.coucou(httpbin.url) - """ - ) + """) result = pytester.runpytest( "--httpdbg", @@ -125,14 +119,12 @@ def test_without_initiator(pytester, tmp_path): ".py", fakepackage="import requests\ndef coucou(url):\n requests.get(url)\n" ) - pytester.makepyfile( - """ + pytester.makepyfile(""" import fakepackage def test_without_initiator_fake(httpbin): fakepackage.coucou(httpbin.url) - """ - ) + """) result = pytester.runpytest("--httpdbg", "--httpdbg-dir", str(logs_dir))