Skip to content

Commit

Permalink
ci: Use PYTHONWARNINGS=error
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Apr 6, 2022
1 parent 02cb5ca commit 40ce2e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- run: pip install .[test]
- run: pytest --cov jscc --vcr-record=none tests
- env:
PYTHONWARNINGS: error
run: pytest --cov jscc --vcr-record=none tests
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
8 changes: 5 additions & 3 deletions tests/test_checks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import contextlib
import json
import os
import warnings

import pytest
from jsonref import JsonRef
Expand Down Expand Up @@ -236,10 +237,11 @@ def allow_missing(pointer):

def test_validate_ref_pass():
filepath = os.path.join('schema', 'schema.json')
with pytest.warns(None) as records:
errors = validate_ref(path(filepath), parse(filepath))

assert errors == len(records) == 0
with warnings.catch_warnings():
warnings.simplefilter('error')

errors = validate_ref(path(filepath), parse(filepath))


def test_validate_ref_fail():
Expand Down

0 comments on commit 40ce2e5

Please sign in to comment.