Skip to content

Commit 72e1528

Browse files
committed
make targets for running tests with coverage as well as to skip slow tests
1 parent c7cd926 commit 72e1528

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ install:
1414
- "pip install mypy"
1515
script:
1616
- export PYTHONPATH=./src:$PYTHONPATH
17-
- coverage erase
18-
- make test
19-
- mv .coverage .coverage.1
20-
- coverage combine
17+
- make test_coverage
2118
- make typecheck
2219
before_install:
2320
- sudo apt-get update -qq

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ SOURCE= $(SRCDIR)/pyff
55
test:
66
PYTHONPATH=$(SRCDIR) pytest
77

8+
quick_test:
9+
PYFF_SKIP_SLOW_TESTS=1 PYTHONPATH=$(SRCDIR) pytest
10+
11+
test_coverage:
12+
coverage erase
13+
PYTHONPATH=$(SRCDIR) pytest --cov=src/pyff
14+
mv .coverage .coverage.1
15+
coverage combine
16+
817
reformat:
918
isort --line-width 120 --atomic --project eduid_scimapi --recursive $(SOURCE)
1019
black --line-length 120 --target-version py37 --skip-string-normalization $(SOURCE)

src/pyff/test/test_md_api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import unittest
44
from datetime import datetime, timezone
55

6+
import pytest
67
import requests
78
from mako.lookup import TemplateLookup
89
from wsgi_intercept.interceptor import RequestsInterceptor, UrllibInterceptor
@@ -96,6 +97,7 @@ def test_webfinger_rel_dj(self):
9697
assert link['rel'] not in 'urn:oasis:names:tc:SAML:2.0:metadata'
9798
assert 'href' in link
9899

100+
@pytest.mark.skipif(os.environ.get('PYFF_SKIP_SLOW_TESTS') is not None, reason='Slow tests skipped')
99101
def test_load_and_query(self):
100102
with RequestsInterceptor(self.app, host='127.0.0.1', port=80) as url:
101103
r = requests.post("{}/api/call/update".format(url))

0 commit comments

Comments
 (0)