Fix coverage setup
This commit is contained in:
parent
0bb4b18e1d
commit
daa7f3b43c
|
|
@ -16,9 +16,10 @@ before_script:
|
||||||
- git checkout master
|
- git checkout master
|
||||||
- ./cc-test-reporter before-build
|
- ./cc-test-reporter before-build
|
||||||
script:
|
script:
|
||||||
- pytest
|
- coverage run -m pytest
|
||||||
- coverage run -a ./update.py --release
|
- coverage run -a ./update.py --release
|
||||||
after_script:
|
after_script:
|
||||||
|
- coverage xml && coverage report
|
||||||
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
[pytest]
|
|
||||||
addopts = --cov=.
|
|
||||||
|
|
@ -2,4 +2,4 @@ requests ~= 2.21.0
|
||||||
beautifulsoup4 ~= 4.7.1
|
beautifulsoup4 ~= 4.7.1
|
||||||
tqdm ~= 4.30.0
|
tqdm ~= 4.30.0
|
||||||
pytest ~= 4.3.0
|
pytest ~= 4.3.0
|
||||||
pytest-cov ~= 2.6.1
|
coverage ~= 4.5.3
|
||||||
|
|
|
||||||
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
|
|
@ -1,16 +1,9 @@
|
||||||
"""pytest config"""
|
"""Tools for files. """
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
|
|
||||||
__dirname__ = os.path.abspath(os.path.dirname(__file__))
|
__dirname__ = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
||||||
|
|
||||||
def _file_path(*other):
|
def _file_path(*other):
|
||||||
|
|
||||||
return os.path.abspath(os.path.join(__dirname__, *other))
|
return os.path.abspath(os.path.join(__dirname__, *other))
|
||||||
|
|
||||||
|
|
||||||
def pytest_configure(config):
|
|
||||||
sys.path.insert(0, _file_path('..'))
|
|
||||||
return config
|
|
||||||
|
|
@ -2,9 +2,10 @@
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from conftest import _file_path
|
|
||||||
from fetch_holidays import CustomJSONEncoder, DescriptionParser
|
from fetch_holidays import CustomJSONEncoder, DescriptionParser
|
||||||
|
|
||||||
|
from .filetools import _file_path
|
||||||
|
|
||||||
|
|
||||||
def _normalize(iterable):
|
def _normalize(iterable):
|
||||||
return sorted(json.loads(json.dumps(list(iterable), cls=CustomJSONEncoder)),
|
return sorted(json.loads(json.dumps(list(iterable), cls=CustomJSONEncoder)),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user