diff --git a/scripts/pyproject.toml b/scripts/pyproject.toml index 2aa44e15..d148592d 100644 --- a/scripts/pyproject.toml +++ b/scripts/pyproject.toml @@ -47,7 +47,7 @@ python = "3.11" [tool.hatch.envs.test] features = ["test"] [tool.hatch.envs.test.scripts] -test = "pytest" +run = "pytest -v {args}" [tool.pytest.ini_options] addopts = [ @@ -59,11 +59,9 @@ addopts = [ filterwarnings = ["error"] [tool.black] -target-version = ["py310"] # py311 not supported yet line-length = 120 [tool.ruff] -target-version = "py311" line-length = 120 allowed-confusables = ["’", "×"] select = [ diff --git a/scripts/tests/test_cruft.py b/scripts/tests/test_cruft.py index 0615eb23..db532014 100644 --- a/scripts/tests/test_cruft.py +++ b/scripts/tests/test_cruft.py @@ -1,6 +1,7 @@ import json from dataclasses import dataclass from typing import cast +from warnings import catch_warnings, filterwarnings import pytest from git import Commit, Diff @@ -28,8 +29,11 @@ class MockRelease: @pytest.fixture def con(response_mock) -> GitHubConnection: resp = json.dumps({"login": "scverse-bot"}) - with response_mock(f"GET https://api.github.com:443/users/scverse-bot -> 200 :{resp}"): - return GitHubConnection("scverse-bot") + with catch_warnings(): + # https://github.com/idlesign/pytest-responsemock/issues/7 + filterwarnings("ignore", category=ResourceWarning) + with response_mock(f"GET https://api.github.com:443/users/scverse-bot -> 200 :{resp}"): + return GitHubConnection("scverse-bot") @pytest.fixture