ignore examples from type checks

master
Gareth Rushgrove 4 years ago
parent 9124762f37
commit 11c5ef8e56
  1. 1
      .gitignore
  2. 9
      examples/testing/test_validate_cnab.py
  3. 2
      pytest.ini

1
.gitignore vendored

@ -7,3 +7,4 @@ __pycache__
.mypy_cache
.coverage
*.egg-info
schemas

@ -16,20 +16,21 @@ import os
import shutil
from urllib.request import urlopen
from jsonschema import validate
from jsonschema import validate # type: ignore
import pytest
from cnab import Bundle, CNABDirectory
# If we don't already have a schemas directory from a previous run or extra schemas then create one
if not os.path.exists('schemas'):
os.makedirs('schemas')
if not os.path.exists("schemas"):
os.makedirs("schemas")
# We grab the latest version of the schema from the spec repository whenever the tests are run
URL = "https://raw.githubusercontent.com/deislabs/cnab-spec/master/schema/bundle.schema.json"
with urlopen(URL) as response, open("schemas/latest.json", 'wb') as out_file:
with urlopen(URL) as response, open("schemas/latest.json", "wb") as out_file:
shutil.copyfileobj(response, out_file)
@pytest.fixture(scope="module", params=glob.glob("schemas/*.json"))
def schema(request):
"This fixture will pick up multiple schemas if present"

@ -1,5 +1,5 @@
[pytest]
addopts = --black --mypy --verbose --ignore scratch --cov=cnab --cov-report term-missing
addopts = --black --mypy --verbose --ignore scratch --ignore examples --cov=cnab --cov-report term-missing
filterwarnings =
ignore::DeprecationWarning

Loading…
Cancel
Save