Skip to content

Commit c8d54ca

Browse files
authored
spring cleanup (#22)
1 parent 8b3dff4 commit c8d54ca

5 files changed

Lines changed: 26 additions & 41 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
runs-on: ubuntu-latest
99
timeout-minutes: 5
1010
steps:
11-
- uses: actions/checkout@v4
11+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1212
- name: Set up Python ${{ matrix.python-version }}
13-
uses: actions/setup-python@v5
13+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1414
with:
15-
python-version: "3.10"
15+
python-version: "3.14"
1616
- name: Lint code
1717
run: |
1818
make setup
@@ -29,9 +29,9 @@ jobs:
2929
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
3030

3131
steps:
32-
- uses: actions/checkout@v4
32+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3333
- name: Set up Python ${{ matrix.python-version }}
34-
uses: actions/setup-python@v5
34+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
3535
with:
3636
python-version: ${{ matrix.python-version }}
3737
- name: Run tests
@@ -49,9 +49,9 @@ jobs:
4949
id-token: write # IMPORTANT: mandatory for trusted publishing
5050
timeout-minutes: 10
5151
steps:
52-
- uses: actions/checkout@v4
52+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5353
- name: Set up Python ${{ matrix.python-version }}
54-
uses: actions/setup-python@v5
54+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
5555
with:
5656
python-version: 3.11
5757
- name: Install pypa/build
@@ -66,7 +66,7 @@ jobs:
6666
github.event_name == 'push' &&
6767
startsWith(github.ref, 'refs/tags') &&
6868
github.actor == github.repository_owner
69-
uses: actions/upload-artifact@v4
69+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
7070
with:
7171
name: python-package-distributions
7272
path: dist/
@@ -75,4 +75,4 @@ jobs:
7575
github.event_name == 'push' &&
7676
startsWith(github.ref, 'refs/tags') &&
7777
github.actor == github.repository_owner
78-
uses: pypa/gh-action-pypi-publish@release/v1
78+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ setup:
55
pip install -r requirements-dev.txt
66

77
format:
8-
black pytest_httpdbg tests
8+
black pytest_httpdbg tests --target-version py39
99

1010
lint:
11-
black --check pytest_httpdbg tests
11+
black --check pytest_httpdbg tests --target-version py39
1212
flake8 pytest_httpdbg tests
1313

1414
check: lint

pytest_httpdbg/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from pytest_httpdbg.plugin import httpdbg_record_filename # noqa F401
22

3-
__version__ = "0.10.1"
3+
__version__ = "0.10.2"

tests/test_allure.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import pytest
44

5-
65
confest_py = """
76
import pytest
87
import requests
@@ -26,14 +25,12 @@ def fixture_function(httpbin, fixture_session):
2625
def test_mode_mutual_exclusion(pytester):
2726
pytester.makeconftest(confest_py)
2827

29-
pytester.makepyfile(
30-
"""
28+
pytester.makepyfile("""
3129
import requests
3230
3331
def test_get(httpbin, fixture_session, fixture_function):
3432
requests.get(httpbin.url + "/get")
35-
"""
36-
)
33+
""")
3734

3835
result = pytester.runpytest("--httpdbg", "--httpdbg-allure")
3936

@@ -49,17 +46,15 @@ def test_get(httpbin, fixture_session, fixture_function):
4946
def test_mode_allure(pytester, tmp_path):
5047
pytester.makeconftest(confest_py)
5148

52-
pytester.makepyfile(
53-
"""
49+
pytester.makepyfile("""
5450
import requests
5551
5652
def test_get(httpbin, fixture_session, fixture_function):
5753
requests.get(httpbin.url + "/get")
5854
5955
def test_post(httpbin, fixture_session, fixture_function):
6056
requests.post(httpbin.url + "/post", json={"a":"b"})
61-
"""
62-
)
57+
""")
6358

6459
result = pytester.runpytest("--httpdbg-allure", f"--alluredir={tmp_path}")
6560

@@ -92,8 +87,7 @@ def test_post(httpbin, fixture_session, fixture_function):
9287
def test_mode_allure_only_on_failure(pytester, tmp_path):
9388
pytester.makeconftest(confest_py)
9489

95-
pytester.makepyfile(
96-
"""
90+
pytester.makepyfile("""
9791
import requests
9892
9993
def test_pass(httpbin):
@@ -102,8 +96,7 @@ def test_pass(httpbin):
10296
def test_fail(httpbin):
10397
requests.post(httpbin.url + "/post", json={"a":"b"})
10498
assert False
105-
"""
106-
)
99+
""")
107100

108101
result = pytester.runpytest(
109102
"--httpdbg-allure", f"--alluredir={tmp_path}", "--httpdbg-only-on-failure"

tests/test_plugin.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,15 @@ def fixture_function(httpbin, fixture_session):
2929
def test_no_httpdbg(pytester):
3030
pytester.makeconftest(confest_py)
3131

32-
pytester.makepyfile(
33-
"""
32+
pytester.makepyfile("""
3433
import requests
3534
3635
def test_get(httpbin, fixture_session, fixture_function):
3736
requests.get(httpbin.url + "/intest")
3837
3938
def test_post(httpbin, fixture_session):
4039
requests.post(httpbin.url + "/intest")
41-
"""
42-
)
40+
""")
4341

4442
result = pytester.runpytest()
4543

@@ -52,17 +50,15 @@ def test_record_in_dir(pytester, tmp_path):
5250

5351
pytester.makeconftest(confest_py)
5452

55-
pytester.makepyfile(
56-
"""
53+
pytester.makepyfile("""
5754
import requests
5855
5956
def test_get(httpbin, fixture_session, fixture_function):
6057
requests.get(httpbin.url + "/intest")
6158
6259
def test_post(httpbin, fixture_session):
6360
requests.post(httpbin.url + "/intest")
64-
"""
65-
)
61+
""")
6662

6763
result = pytester.runpytest("--httpdbg", "--httpdbg-dir", str(logs_dir))
6864

@@ -87,14 +83,12 @@ def test_with_initiator(pytester, tmp_path):
8783
".py", fakepackage="import requests\ndef coucou(url):\n requests.get(url)\n"
8884
)
8985

90-
pytester.makepyfile(
91-
"""
86+
pytester.makepyfile("""
9287
import fakepackage
9388
9489
def test_with_initiator_fake(httpbin):
9590
fakepackage.coucou(httpbin.url)
96-
"""
97-
)
91+
""")
9892

9993
result = pytester.runpytest(
10094
"--httpdbg",
@@ -125,14 +119,12 @@ def test_without_initiator(pytester, tmp_path):
125119
".py", fakepackage="import requests\ndef coucou(url):\n requests.get(url)\n"
126120
)
127121

128-
pytester.makepyfile(
129-
"""
122+
pytester.makepyfile("""
130123
import fakepackage
131124
132125
def test_without_initiator_fake(httpbin):
133126
fakepackage.coucou(httpbin.url)
134-
"""
135-
)
127+
""")
136128

137129
result = pytester.runpytest("--httpdbg", "--httpdbg-dir", str(logs_dir))
138130

0 commit comments

Comments
 (0)