From 91561ff55a9f520df2c0581e74ca76c28cc5291a Mon Sep 17 00:00:00 2001 From: Francesco Bartoli Date: Sat, 12 Oct 2024 17:18:47 +0200 Subject: [PATCH] Exclude options method --- noxfile.py | 3 +-- tests/test_openapi_contract.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/noxfile.py b/noxfile.py index a2da033..01cf0cd 100644 --- a/noxfile.py +++ b/noxfile.py @@ -160,8 +160,7 @@ def tests(session: NoxPoetrySession) -> None: session.install(".") session.install("coverage[toml]", "pytest", "pygments", "schemathesis") try: - # session.run("coverage", "run", "--parallel", "-m", "pytest", *session.posargs) - session.run("py.test", *session.posargs) + session.run("coverage", "run", "--parallel", "-m", "pytest", *session.posargs) finally: if session.interactive: session.notify("coverage", posargs=[]) diff --git a/tests/test_openapi_contract.py b/tests/test_openapi_contract.py index 81ebc6b..139027d 100644 --- a/tests/test_openapi_contract.py +++ b/tests/test_openapi_contract.py @@ -6,7 +6,7 @@ schema_bearer = schemathesis.from_pytest_fixture("protected_bearer_schema") -@schema_apikey.parametrize() +@schema_apikey.exclude(method="OPTIONS").parametrize() def test_api_with_apikey(case): """Test the API with API-KEY protection.""" if case.path_parameters: @@ -23,7 +23,7 @@ def test_api_with_apikey(case): case.validate_response(response) -@schema_bearer.parametrize() +@schema_bearer.exclude(method="OPTIONS").parametrize() def test_api_with_bearer(case, access_token): """Test the API with Authorization Bearer token protection.""" if case.path_parameters: