diff --git a/pyproject.toml b/pyproject.toml index 74fbca53c0..61e3e9822b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -314,6 +314,9 @@ addopts = [ "--numprocesses=auto", "--strict-markers", ] +filterwarnings = [ + "error::pytest.PytestWarning", +] markers = [ "minio: mark test as requiring minio", "opensearch: mark test as requiring opensearch", diff --git a/tests/manager/core/test_http.py b/tests/manager/core/test_http.py index 649f1fdbc3..9c02baa8cf 100644 --- a/tests/manager/core/test_http.py +++ b/tests/manager/core/test_http.py @@ -10,7 +10,7 @@ @dataclass -class TestHttpFixture: +class HttpTestFixture: server: MockAPIServer request_with_timeout: Callable[..., requests.Response] @@ -21,13 +21,13 @@ def test_http_fixture(mock_web_server: MockAPIServer): request_with_timeout = functools.partial( HTTP.request_with_timeout, timeout=1, backoff_factor=0 ) - return TestHttpFixture( + return HttpTestFixture( server=mock_web_server, request_with_timeout=request_with_timeout ) class TestHTTP: - def test_retries_unspecified(self, test_http_fixture: TestHttpFixture): + def test_retries_unspecified(self, test_http_fixture: HttpTestFixture): for i in range(1, 7): response = MockAPIServerResponse() response.content = b"Ouch." @@ -44,7 +44,7 @@ def test_retries_unspecified(self, test_http_fixture: TestHttpFixture): assert request.path == "/test" assert request.method == "GET" - def test_retries_none(self, test_http_fixture: TestHttpFixture): + def test_retries_none(self, test_http_fixture: HttpTestFixture): response = MockAPIServerResponse() response.content = b"Ouch." response.status_code = 502 @@ -60,7 +60,7 @@ def test_retries_none(self, test_http_fixture: TestHttpFixture): assert request.path == "/test" assert request.method == "GET" - def test_retries_3(self, test_http_fixture: TestHttpFixture): + def test_retries_3(self, test_http_fixture: HttpTestFixture): response0 = MockAPIServerResponse() response0.content = b"Ouch." response0.status_code = 502 diff --git a/tests/manager/sqlalchemy/model/test_licensing.py b/tests/manager/sqlalchemy/model/test_licensing.py index 7a93f29999..edbd5ab8bd 100644 --- a/tests/manager/sqlalchemy/model/test_licensing.py +++ b/tests/manager/sqlalchemy/model/test_licensing.py @@ -265,7 +265,7 @@ def test_unique_uri_constraint(self, db: DatabaseTransactionFixture): pytest.raises(IntegrityError, db.session.commit) -class TestLicenseFixture: +class LicenseTestFixture: def __init__(self, db: DatabaseTransactionFixture) -> None: self.db = db self.pool = db.licensepool(None) @@ -327,12 +327,12 @@ def __init__(self, db: DatabaseTransactionFixture) -> None: @pytest.fixture(scope="function") -def licenses(db: DatabaseTransactionFixture) -> TestLicenseFixture: - return TestLicenseFixture(db) +def licenses(db: DatabaseTransactionFixture) -> LicenseTestFixture: + return LicenseTestFixture(db) class TestLicense: - def test_loan_to(self, licenses: TestLicenseFixture): + def test_loan_to(self, licenses: LicenseTestFixture): # Verify that loaning a license also loans its pool. pool = licenses.pool license = licenses.perpetual @@ -379,7 +379,7 @@ def test_license_types( is_inactive, total_remaining_loans, currently_available_loans, - licenses: TestLicenseFixture, + licenses: LicenseTestFixture, ): license = getattr(licenses, license_type) assert is_perpetual == license.is_perpetual @@ -402,7 +402,7 @@ def test_license_types( ], ) def test_license_checkout( - self, license_type, left, available, licenses: TestLicenseFixture + self, license_type, left, available, licenses: LicenseTestFixture ): license = getattr(licenses, license_type) license.checkout() @@ -460,14 +460,14 @@ def test_license_checkout( ], ) def test_license_checkin( - self, license_params, left, available, licenses: TestLicenseFixture + self, license_params, left, available, licenses: LicenseTestFixture ): l = licenses.db.license(licenses.pool, **license_params) l.checkin() assert left == l.checkouts_left assert available == l.checkouts_available - def test_best_available_license(self, licenses: TestLicenseFixture): + def test_best_available_license(self, licenses: LicenseTestFixture): next_week = utc_now() + datetime.timedelta(days=7) time_limited_2 = licenses.db.license( licenses.pool,