Skip to content

Commit

Permalink
Merge pull request #169 from p1c2u/feature/tests-mark-network
Browse files Browse the repository at this point in the history
tests mark network
  • Loading branch information
p1c2u committed Sep 2, 2022
2 parents 73236a7 + 621a6d2 commit d44657a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ addopts = """
--cov-report=term-missing
--cov-report=xml
"""
markers = [
"network: marks tests which do need network-enabled environment",
]

[tool.black]
line-length = 79
Expand Down
12 changes: 7 additions & 5 deletions tests/integration/test_shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_spec_schema_version_not_detected(self):
validate_spec(spec)


class TestValidateSpecUrl:
class TestLocalValidateSpecUrl:
def test_spec_schema_version_not_detected(self, factory):
spec_path = "data/empty.yaml"
spec_url = factory.spec_file_url(spec_path)
Expand All @@ -31,7 +31,7 @@ def test_spec_schema_version_not_detected(self, factory):
validate_spec_url(spec_url)


class TestValidatev2Spec:
class TestLiocalValidatev2Spec:

LOCAL_SOURCE_DIRECTORY = "data/v2.0/"

Expand Down Expand Up @@ -68,7 +68,7 @@ def test_falied(self, factory, spec_file):
validate_v2_spec(spec)


class TestValidatev30Spec:
class TestLocalValidatev30Spec:

LOCAL_SOURCE_DIRECTORY = "data/v3.0/"

Expand Down Expand Up @@ -105,7 +105,8 @@ def test_falied(self, factory, spec_file):
validate_v30_spec(spec)


class TestValidatev2SpecUrl:
@pytest.mark.network
class TestRemoteValidatev2SpecUrl:

REMOTE_SOURCE_URL = (
"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/"
Expand Down Expand Up @@ -134,7 +135,8 @@ def test_valid(self, spec_file):
validate_spec_url_factory(openapi_v2_spec_validator)(spec_url)


class TestValidatev30SpecUrl:
@pytest.mark.network
class TestRemoteValidatev30SpecUrl:

REMOTE_SOURCE_URL = (
"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/"
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/validation/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def test_falied(self, factory, validator_v30, spec_file):
validator_v30.validate(spec, spec_url=spec_url)


@pytest.mark.network
class TestRemoteOpenAPIv30Validator:

REMOTE_SOURCE_URL = (
Expand Down Expand Up @@ -67,6 +68,7 @@ def test_valid(self, factory, validator_v30, spec_file):
return validator_v30.validate(spec, spec_url=spec_url)


@pytest.mark.network
class TestRemoteOpeAPIv31Validator:

REMOTE_SOURCE_URL = (
Expand Down

0 comments on commit d44657a

Please sign in to comment.