Skip to content

Commit d44657a

Browse files
authored
Merge pull request #169 from p1c2u/feature/tests-mark-network
tests mark network
2 parents 73236a7 + 621a6d2 commit d44657a

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ addopts = """
7676
--cov-report=term-missing
7777
--cov-report=xml
7878
"""
79+
markers = [
80+
"network: marks tests which do need network-enabled environment",
81+
]
7982

8083
[tool.black]
8184
line-length = 79

tests/integration/test_shortcuts.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_spec_schema_version_not_detected(self):
2222
validate_spec(spec)
2323

2424

25-
class TestValidateSpecUrl:
25+
class TestLocalValidateSpecUrl:
2626
def test_spec_schema_version_not_detected(self, factory):
2727
spec_path = "data/empty.yaml"
2828
spec_url = factory.spec_file_url(spec_path)
@@ -31,7 +31,7 @@ def test_spec_schema_version_not_detected(self, factory):
3131
validate_spec_url(spec_url)
3232

3333

34-
class TestValidatev2Spec:
34+
class TestLiocalValidatev2Spec:
3535

3636
LOCAL_SOURCE_DIRECTORY = "data/v2.0/"
3737

@@ -68,7 +68,7 @@ def test_falied(self, factory, spec_file):
6868
validate_v2_spec(spec)
6969

7070

71-
class TestValidatev30Spec:
71+
class TestLocalValidatev30Spec:
7272

7373
LOCAL_SOURCE_DIRECTORY = "data/v3.0/"
7474

@@ -105,7 +105,8 @@ def test_falied(self, factory, spec_file):
105105
validate_v30_spec(spec)
106106

107107

108-
class TestValidatev2SpecUrl:
108+
@pytest.mark.network
109+
class TestRemoteValidatev2SpecUrl:
109110

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

136137

137-
class TestValidatev30SpecUrl:
138+
@pytest.mark.network
139+
class TestRemoteValidatev30SpecUrl:
138140

139141
REMOTE_SOURCE_URL = (
140142
"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/"

tests/integration/validation/test_validators.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def test_falied(self, factory, validator_v30, spec_file):
4040
validator_v30.validate(spec, spec_url=spec_url)
4141

4242

43+
@pytest.mark.network
4344
class TestRemoteOpenAPIv30Validator:
4445

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

6970

71+
@pytest.mark.network
7072
class TestRemoteOpeAPIv31Validator:
7173

7274
REMOTE_SOURCE_URL = (

0 commit comments

Comments
 (0)