Skip to content

Commit 5a32fdb

Browse files
authored
deps(deps-dev): bump the python-development group with 3 updates (#328)
Bumps the python-development group with 3 updates: [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures), [responses](https://github.com/getsentry/responses) and [ruff](https://github.com/astral-sh/ruff). Updates `pytest-rerunfailures` from 16.2 to 16.3 <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst">pytest-rerunfailures's changelog</a>.</em></p> <blockquote> <h2>16.3 (2026-05-22)</h2> <p>Features ++++++++</p> <ul> <li> <p>Add <code>--reruns-mode</code> option (<code>strict</code> or <code>append</code>). With <code>append</code>, marker reruns and the global <code>--reruns</code> / <code>reruns</code> ini setting are summed instead of the marker taking strict priority. Default is <code>strict</code> so existing behaviour is unchanged. Fixes <code>[#321](pytest-dev/pytest-rerunfailures#321) &lt;https://github.com/pytest-dev/pytest-rerunfailures/issues/321&gt;</code>_.</p> </li> <li> <p>Add <code>--rerun-show-tracebacks</code> option to display tracebacks from failed attempts that were retried, including tests that eventually passed. The rerun summary section is emitted automatically when the flag is set, so <code>-rR</code> is no longer required to see the tracebacks. Fixes <code>[#156](pytest-dev/pytest-rerunfailures#156) &lt;https://github.com/pytest-dev/pytest-rerunfailures/issues/156&gt;</code>_.</p> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/pytest-dev/pytest-rerunfailures/commit/4b3a2200b07b357cecfe192f4997f35764869c6f"><code>4b3a220</code></a> Preparing release 16.3</li> <li><a href="https://github.com/pytest-dev/pytest-rerunfailures/commit/d17f3be1c8cc257c29cd7d7e815d3c52867b1276"><code>d17f3be</code></a> feat: add --reruns-mode option to sum marker and global reruns (<a href="https://redirect.github.com/pytest-dev/pytest-rerunfailures/issues/321">#321</a>) (<a href="https://redirect.github.com/pytest-dev/pytest-rerunfailures/issues/328">#328</a>)</li> <li><a href="https://github.com/pytest-dev/pytest-rerunfailures/commit/4a00facae37246c00801390039286d322df6e322"><code>4a00fac</code></a> Add --rerun-show-tracebacks to surface retried failures (<a href="https://redirect.github.com/pytest-dev/pytest-rerunfailures/issues/329">#329</a>)</li> <li><a href="https://github.com/pytest-dev/pytest-rerunfailures/commit/9f792d9efe6bf0218e7ba2734257af2d5165ca3f"><code>9f792d9</code></a> Back to development: 16.3</li> <li>See full diff in <a href="https://github.com/pytest-dev/pytest-rerunfailures/compare/16.2...16.3">compare view</a></li> </ul> </details> <br /> Updates `responses` from 0.26.0 to 0.26.1 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/getsentry/responses/releases">responses's releases</a>.</em></p> <blockquote> <h2>0.26.1</h2> <ul> <li>Added Spanish translation of the README (<code>README.es.rst</code>)</li> <li>When both <code>content_type</code> and <code>headers['content-type']</code> are in a response mock file, <code>content_type</code> is now used.</li> <li>Added strict_match to urlencoded_params_matcher, enabling partial request parameter matching.</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/getsentry/responses/blob/master/CHANGES">responses's changelog</a>.</em></p> <blockquote> <h2>0.26.1</h2> <ul> <li>Added Spanish translation of the README (<code>README.es.rst</code>)</li> <li>When both <code>content_type</code> and <code>headers['content-type']</code> are in a response mock file, <code>content_type</code> is now used.</li> <li>Added strict_match to urlencoded_params_matcher, enabling partial request parameter matching.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/getsentry/responses/commit/7a80232a3716cadde4b0aa36b34cc56006366179"><code>7a80232</code></a> release: 0.26.1</li> <li><a href="https://github.com/getsentry/responses/commit/1fda8978e1c927706f82c1baafe30d9c013972ca"><code>1fda897</code></a> Add strict_match parameter to urlencoded_params_matcher (<a href="https://redirect.github.com/getsentry/responses/issues/796">#796</a>)</li> <li><a href="https://github.com/getsentry/responses/commit/ab8d4808bf973aa968757755bf9ea38621a4d070"><code>ab8d480</code></a> chore: Fix lint build and update changes (<a href="https://redirect.github.com/getsentry/responses/issues/795">#795</a>)</li> <li><a href="https://github.com/getsentry/responses/commit/71be9a2f9718f0f4d5c3feb28ba7e3797b7bdfc0"><code>71be9a2</code></a> fix: remove content-type from headers in _add_from_file to avoid RuntimeError...</li> <li><a href="https://github.com/getsentry/responses/commit/84c2b081402f61eaf25ef9b27b0bc425bb48479e"><code>84c2b08</code></a> Add Spanish translation of the README documentation (<a href="https://redirect.github.com/getsentry/responses/issues/790">#790</a>)</li> <li><a href="https://github.com/getsentry/responses/commit/3da192e3253c57eb69bc9b46d09154e37abcd8aa"><code>3da192e</code></a> chore: pin GitHub Actions to full-length commit SHAs (<a href="https://redirect.github.com/getsentry/responses/issues/789">#789</a>)</li> <li><a href="https://github.com/getsentry/responses/commit/cc53d778e2adf7a060f1eb04bc5c107d49d4d1a9"><code>cc53d77</code></a> Merge branch 'release/0.26.0'</li> <li>See full diff in <a href="https://github.com/getsentry/responses/compare/0.26.0...0.26.1">compare view</a></li> </ul> </details> <br /> Updates `ruff` from 0.15.13 to 0.15.14 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/astral-sh/ruff/releases">ruff's releases</a>.</em></p> <blockquote> <h2>0.15.14</h2> <h2>Release Notes</h2> <p>Released on 2026-05-21.</p> <h3>Preview features</h3> <ul> <li>[<code>airflow</code>] Implement <code>airflow-task-implicit-multiple-outputs</code> (<code>AIR202</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25152">#25152</a>)</li> <li>[<code>flake8-use-pathlib</code>] Mark <code>PTH101</code> fix as unsafe when first argument is a class attribute annotated as <code>int</code> (<a href="https://redirect.github.com/astral-sh/ruff/pull/25086">#25086</a>)</li> <li>[<code>pylint</code>] Implement <code>too-many-try-statements</code> (<code>W0717</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23970">#23970</a>)</li> <li>[<code>ruff</code>] Add <code>incorrect-decorator-order</code> (<code>RUF074</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23461">#23461</a>)</li> <li>[<code>ruff</code>] Add <code>fallible-context-manager</code> (<code>RUF075</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/22844">#22844</a>)</li> </ul> <h3>Bug fixes</h3> <ul> <li>Fix lambda formatting in interpolated string expressions (<a href="https://redirect.github.com/astral-sh/ruff/pull/25144">#25144</a>)</li> <li>Treat generic <code>frozenset</code> annotations as immutable (<a href="https://redirect.github.com/astral-sh/ruff/pull/25251">#25251</a>)</li> <li>[<code>flake8-type-checking</code>] Avoid <code>strict</code> behavior when <code>future-annotations</code> are enabled (<code>TC001</code>, <code>TC002</code>, <code>TC003</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25035">#25035</a>)</li> <li>[<code>pylint</code>] Avoid false positives in <code>else</code> clause (<code>PLR1733</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25177">#25177</a>)</li> </ul> <h3>Rule changes</h3> <ul> <li>[<code>flake8-comprehensions</code>] Skip <code>C417</code> for lambdas with positional-only parameters (<a href="https://redirect.github.com/astral-sh/ruff/pull/25272">#25272</a>)</li> <li>[<code>flake8-simplify</code>] Preserve f-string source verbatim in <code>SIM101</code> fix (<a href="https://redirect.github.com/astral-sh/ruff/pull/25061">#25061</a>)</li> </ul> <h3>Performance</h3> <ul> <li>Avoid unnecessary parser lookahead for operators (<a href="https://redirect.github.com/astral-sh/ruff/pull/25290">#25290</a>)</li> </ul> <h3>Documentation</h3> <ul> <li>Update code example setting Neovim LSP log level (<a href="https://redirect.github.com/astral-sh/ruff/pull/25284">#25284</a>)</li> </ul> <h3>Other changes</h3> <ul> <li>Add full PEP 798 support (<a href="https://redirect.github.com/astral-sh/ruff/pull/25104">#25104</a>)</li> <li>Add a parser recursion limit (<a href="https://redirect.github.com/astral-sh/ruff/pull/24810">#24810</a>)</li> <li>Update various <code>ruff_python_stdlib</code> APIs (<a href="https://redirect.github.com/astral-sh/ruff/pull/25273">#25273</a>)</li> </ul> <h3>Contributors</h3> <ul> <li><a href="https://github.com/ocaballeror"><code>@​ocaballeror</code></a></li> <li><a href="https://github.com/lerebear"><code>@​lerebear</code></a></li> <li><a href="https://github.com/samuelcolvin"><code>@​samuelcolvin</code></a></li> <li><a href="https://github.com/baltasarblanco"><code>@​baltasarblanco</code></a></li> <li><a href="https://github.com/aconal-com"><code>@​aconal-com</code></a></li> <li><a href="https://github.com/anishgirianish"><code>@​anishgirianish</code></a></li> <li><a href="https://github.com/JelleZijlstra"><code>@​JelleZijlstra</code></a></li> <li><a href="https://github.com/AlexWaygood"><code>@​AlexWaygood</code></a></li> <li><a href="https://github.com/ntBre"><code>@​ntBre</code></a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md">ruff's changelog</a>.</em></p> <blockquote> <h2>0.15.14</h2> <p>Released on 2026-05-21.</p> <h3>Preview features</h3> <ul> <li>[<code>airflow</code>] Implement <code>airflow-task-implicit-multiple-outputs</code> (<code>AIR202</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25152">#25152</a>)</li> <li>[<code>flake8-use-pathlib</code>] Mark <code>PTH101</code> fix as unsafe when first argument is a class attribute annotated as <code>int</code> (<a href="https://redirect.github.com/astral-sh/ruff/pull/25086">#25086</a>)</li> <li>[<code>pylint</code>] Implement <code>too-many-try-statements</code> (<code>W0717</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23970">#23970</a>)</li> <li>[<code>ruff</code>] Add <code>incorrect-decorator-order</code> (<code>RUF074</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23461">#23461</a>)</li> <li>[<code>ruff</code>] Add <code>fallible-context-manager</code> (<code>RUF075</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/22844">#22844</a>)</li> </ul> <h3>Bug fixes</h3> <ul> <li>Fix lambda formatting in interpolated string expressions (<a href="https://redirect.github.com/astral-sh/ruff/pull/25144">#25144</a>)</li> <li>Treat generic <code>frozenset</code> annotations as immutable (<a href="https://redirect.github.com/astral-sh/ruff/pull/25251">#25251</a>)</li> <li>[<code>flake8-type-checking</code>] Avoid <code>strict</code> behavior when <code>future-annotations</code> are enabled (<code>TC001</code>, <code>TC002</code>, <code>TC003</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25035">#25035</a>)</li> <li>[<code>pylint</code>] Avoid false positives in <code>else</code> clause (<code>PLR1733</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25177">#25177</a>)</li> </ul> <h3>Rule changes</h3> <ul> <li>[<code>flake8-comprehensions</code>] Skip <code>C417</code> for lambdas with positional-only parameters (<a href="https://redirect.github.com/astral-sh/ruff/pull/25272">#25272</a>)</li> <li>[<code>flake8-simplify</code>] Preserve f-string source verbatim in <code>SIM101</code> fix (<a href="https://redirect.github.com/astral-sh/ruff/pull/25061">#25061</a>)</li> </ul> <h3>Performance</h3> <ul> <li>Avoid unnecessary parser lookahead for operators (<a href="https://redirect.github.com/astral-sh/ruff/pull/25290">#25290</a>)</li> </ul> <h3>Documentation</h3> <ul> <li>Update code example setting Neovim LSP log level (<a href="https://redirect.github.com/astral-sh/ruff/pull/25284">#25284</a>)</li> </ul> <h3>Other changes</h3> <ul> <li>Add full PEP 798 support (<a href="https://redirect.github.com/astral-sh/ruff/pull/25104">#25104</a>)</li> <li>Add a parser recursion limit (<a href="https://redirect.github.com/astral-sh/ruff/pull/24810">#24810</a>)</li> <li>Update various <code>ruff_python_stdlib</code> APIs (<a href="https://redirect.github.com/astral-sh/ruff/pull/25273">#25273</a>)</li> </ul> <h3>Contributors</h3> <ul> <li><a href="https://github.com/ocaballeror"><code>@​ocaballeror</code></a></li> <li><a href="https://github.com/lerebear"><code>@​lerebear</code></a></li> <li><a href="https://github.com/samuelcolvin"><code>@​samuelcolvin</code></a></li> <li><a href="https://github.com/baltasarblanco"><code>@​baltasarblanco</code></a></li> <li><a href="https://github.com/aconal-com"><code>@​aconal-com</code></a></li> <li><a href="https://github.com/anishgirianish"><code>@​anishgirianish</code></a></li> <li><a href="https://github.com/JelleZijlstra"><code>@​JelleZijlstra</code></a></li> <li><a href="https://github.com/AlexWaygood"><code>@​AlexWaygood</code></a></li> <li><a href="https://github.com/ntBre"><code>@​ntBre</code></a></li> <li><a href="https://github.com/adityasingh2400"><code>@​adityasingh2400</code></a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/astral-sh/ruff/commit/9ad2da3015e5faf73bdc5f1d09df3e47238e3edf"><code>9ad2da3</code></a> Bump 0.15.14 (<a href="https://redirect.github.com/astral-sh/ruff/issues/25295">#25295</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/c714e84952510696c05ec21b0158a3548898f594"><code>c714e84</code></a> [ty] Modernize setup of union types in mdtests (<a href="https://redirect.github.com/astral-sh/ruff/issues/25291">#25291</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/8a8e35ebfe318e2467a0f276e5d1a3a9032a55ad"><code>8a8e35e</code></a> [<code>flake8-comprehensions</code>] Skip <code>C417</code> for lambdas with positional-only parame...</li> <li><a href="https://github.com/astral-sh/ruff/commit/aea5ed4d278017057c2e842c6c3a2e92ad71495f"><code>aea5ed4</code></a> Avoid unnecessary parser lookahead for operators (<a href="https://redirect.github.com/astral-sh/ruff/issues/25290">#25290</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/e9d72bb420f26c23e6660bfce4dfa0028b931bff"><code>e9d72bb</code></a> [ty] Allow enum member accesses on <code>self</code> (<a href="https://redirect.github.com/astral-sh/ruff/issues/25077">#25077</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/6cbd59b511a92d5f408db57bde33367c0d47b672"><code>6cbd59b</code></a> Set <code>exclude-newer = &quot;7 days&quot;</code> in our PEP-723 scripts (<a href="https://redirect.github.com/astral-sh/ruff/issues/25285">#25285</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/9999a3967ae28fe3295131e8883b6947f272a076"><code>9999a39</code></a> Update code example on how to update Neovim LSP log level (<a href="https://redirect.github.com/astral-sh/ruff/issues/25284">#25284</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/67d8c544f0d1c526a2fc60d4bb1358fd7956d178"><code>67d8c54</code></a> [ty] Retain recursively-defined state in binary expressions (<a href="https://redirect.github.com/astral-sh/ruff/issues/25277">#25277</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/25a3191140dc0467f9d196f35c128fefde269261"><code>25a3191</code></a> [ty] Refine Callable class-decorator fallback for unknown results (<a href="https://redirect.github.com/astral-sh/ruff/issues/25250">#25250</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/c423054dc09e5b644c926b6b527b6accfbe693e9"><code>c423054</code></a> Add a recursion limit to the parser (<a href="https://redirect.github.com/astral-sh/ruff/issues/24810">#24810</a>)</li> <li>Additional commits viewable in <a href="https://github.com/astral-sh/ruff/compare/0.15.13...0.15.14">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details>
2 parents 23edc5a + 9648747 commit 5a32fdb

8 files changed

Lines changed: 94 additions & 60 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.15.13
3+
rev: v0.15.14
44
hooks:
55
- id: ruff-check
66
- id: ruff-format

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dev = [
4343
"pytest-mock==3.15.*",
4444
"pytest-randomly==4.1.*",
4545
"pytest-reportportal==5.6.*",
46-
"pytest-rerunfailures==16.2.*",
46+
"pytest-rerunfailures==16.3.*",
4747
"pytest-xdist==3.8.*",
4848
"responses==0.26.*",
4949
"respx==0.23.*",

tests/e2e/commerce/order/asset/test_async_asset.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,21 @@
88
pytestmark = [pytest.mark.flaky]
99

1010

11+
async def _delete_order_asset(resource_manager, resource):
12+
try:
13+
await resource_manager.delete(resource.id)
14+
except MPTAPIError as error:
15+
print(f"TEARDOWN - Unable to delete order asset: {getattr(error, 'title', str(error))}") # noqa: WPS421
16+
17+
1118
@asynccontextmanager
1219
async def async_create_fixture_resource_and_delete(resource_manager, resource_data):
1320
resource = await resource_manager.create(resource_data)
1421

15-
yield resource
16-
1722
try:
18-
await resource_manager.delete(resource.id)
19-
except MPTAPIError as error:
20-
print(f"TEARDOWN - Unable to delete order asset: {getattr(error, 'title', str(error))}") # noqa: WPS421
23+
yield resource
24+
finally:
25+
await _delete_order_asset(resource_manager, resource)
2126

2227

2328
@pytest.fixture

tests/e2e/commerce/order/asset/test_sync_asset.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,21 @@
88
pytestmark = [pytest.mark.flaky]
99

1010

11+
def _delete_order_asset(resource_manager, resource):
12+
try:
13+
resource_manager.delete(resource.id)
14+
except MPTAPIError as error:
15+
print(f"TEARDOWN - Unable to delete order asset: {getattr(error, 'title', str(error))}") # noqa: WPS421
16+
17+
1118
@contextmanager
1219
def create_fixture_resource_and_delete(resource_manager, resource_data):
1320
resource = resource_manager.create(resource_data)
1421

15-
yield resource
16-
1722
try:
18-
resource_manager.delete(resource.id)
19-
except MPTAPIError as error:
20-
print(f"TEARDOWN - Unable to delete order asset: {getattr(error, 'title', str(error))}") # noqa: WPS421
23+
yield resource
24+
finally:
25+
_delete_order_asset(resource_manager, resource)
2126

2227

2328
@pytest.fixture

tests/e2e/commerce/order/subscription/test_async_subscription.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,23 @@
88
pytestmark = [pytest.mark.flaky]
99

1010

11+
async def _delete_subscription(resource_manager, resource):
12+
try:
13+
await resource_manager.delete(resource.id)
14+
except MPTAPIError as error:
15+
print( # noqa: WPS421
16+
f"TEARDOWN - Unable to delete subscription: {getattr(error, 'title', str(error))}"
17+
)
18+
19+
1120
@asynccontextmanager
1221
async def async_create_fixture_resource_and_delete(resource_manager, resource_data):
1322
resource = await resource_manager.create(resource_data)
1423

15-
yield resource
16-
1724
try:
18-
await resource_manager.delete(resource.id)
19-
except MPTAPIError as error:
20-
print(f"TEARDOWN - Unable to delete subscription: {getattr(error, 'title', str(error))}") # noqa: WPS421
25+
yield resource
26+
finally:
27+
await _delete_subscription(resource_manager, resource)
2128

2229

2330
@pytest.fixture

tests/e2e/commerce/order/subscription/test_sync_subscription.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,23 @@
88
pytestmark = [pytest.mark.flaky]
99

1010

11+
def _delete_subscription(resource_manager, resource):
12+
try:
13+
resource_manager.delete(resource.id)
14+
except MPTAPIError as error:
15+
print( # noqa: WPS421
16+
f"TEARDOWN - Unable to delete subscription: {getattr(error, 'title', str(error))}"
17+
)
18+
19+
1120
@contextmanager
1221
def create_fixture_resource_and_delete(resource_manager, resource_data):
1322
resource = resource_manager.create(resource_data)
1423

15-
yield resource
16-
1724
try:
18-
resource_manager.delete(resource.id)
19-
except MPTAPIError as error:
20-
print(f"TEARDOWN - Unable to delete subscription: {getattr(error, 'title', str(error))}") # noqa: WPS421
25+
yield resource
26+
finally:
27+
_delete_subscription(resource_manager, resource)
2128

2229

2330
@pytest.fixture

tests/e2e/helper.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,38 @@
44
from mpt_api_client.exceptions import MPTAPIError
55

66

7-
@asynccontextmanager
8-
async def async_create_fixture_resource_and_delete(service, resource_data):
9-
resource = await service.create(resource_data)
7+
async def _delete_async_resource(service, resource):
8+
try:
9+
await service.delete(resource.id)
10+
except MPTAPIError as error:
11+
print(f"TEARDOWN - Unable to delete resource {resource}: {error.title}") # noqa: WPS421
1012

11-
yield resource
1213

14+
def _delete_resource(service, resource):
1315
try:
14-
await service.delete(resource.id)
16+
service.delete(resource.id)
1517
except MPTAPIError as error:
1618
print(f"TEARDOWN - Unable to delete resource {resource}: {error.title}") # noqa: WPS421
1719

1820

21+
@asynccontextmanager
22+
async def async_create_fixture_resource_and_delete(service, resource_data):
23+
resource = await service.create(resource_data)
24+
25+
try:
26+
yield resource
27+
finally:
28+
await _delete_async_resource(service, resource)
29+
30+
1931
@contextmanager
2032
def create_fixture_resource_and_delete(service, resource_data):
2133
resource = service.create(resource_data)
2234

23-
yield resource
24-
2535
try:
26-
service.delete(resource.id)
27-
except MPTAPIError as error:
28-
print(f"TEARDOWN - Unable to delete resource {resource}: {error.title}") # noqa: WPS421
36+
yield resource
37+
finally:
38+
_delete_resource(service, resource)
2939

3040

3141
async def assert_async_service_filter_with_iterate(service, filter_by_id, select: list[str] | None):

uv.lock

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)