Skip to content

Commit

Permalink
caught validation error exception instead of bare.
Browse files Browse the repository at this point in the history
  • Loading branch information
rshewitt committed Apr 17, 2023
1 parent a3ee199 commit bc57ebc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# from tests.fixtures.data import get_catalog_schema
from utils.json_utilities import open_json
from pathlib import Path
from jsonschema import validate
import jsonschema
import pytest

BASE_DIR = Path(__file__).parents[1]
Expand Down Expand Up @@ -59,9 +59,9 @@ def test_dataset_validity(schema, dataset, is_valid, request):
output = None

try:
validate(json_data, schema=dataset_schema)
jsonschema.validate(json_data, schema=dataset_schema)
output = is_valid
except:
except jsonschema.ValidationError:
output = not is_valid

assert output

1 comment on commit bc57ebc

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
datagovharvester
   __init__.py10100% 
   example.py944 56%
TOTAL10460% 

Tests Skipped Failures Errors Time
15 0 💤 0 ❌ 0 🔥 20.672s ⏱️

Please sign in to comment.