diff --git a/livesync/.coveragerc b/livesync/.coveragerc new file mode 100644 index 0000000..0af9e1b --- /dev/null +++ b/livesync/.coveragerc @@ -0,0 +1,9 @@ +[run] +branch = true +include = indico_* + + +[report] +exclude_lines = + pragma: no cover + def __repr__ diff --git a/livesync/.gitignore b/livesync/.gitignore index 4ae66f6..718c0c5 100644 --- a/livesync/.gitignore +++ b/livesync/.gitignore @@ -4,3 +4,5 @@ *.min.js *.pyc *.egg-info +.coverage +htmlcov/ diff --git a/livesync/indico_livesync/uploader.py b/livesync/indico_livesync/uploader.py index 957a114..364d12a 100644 --- a/livesync/indico_livesync/uploader.py +++ b/livesync/indico_livesync/uploader.py @@ -65,7 +65,7 @@ class Uploader(object): :param from_queue: if `records` contains queue entries. expect events if it is False. """ - raise NotImplementedError + raise NotImplementedError # pragma: no cover def processed_records(self, records): """Executed after successfully uploading a batch of records from the queue. @@ -87,4 +87,4 @@ class MARCXMLUploader(Uploader): def upload_xml(self, xml): """Receives MARCXML strings to be uploaded""" - raise NotImplementedError + raise NotImplementedError # pragma: no cover diff --git a/livesync/pytest.ini b/livesync/pytest.ini new file mode 100644 index 0000000..6c6e352 --- /dev/null +++ b/livesync/pytest.ini @@ -0,0 +1,5 @@ +[pytest] +; more verbose summary (include skip/fail/error/warning), coverage +addopts = -rsfEw --cov . --cov-report html --no-cov-on-fail +; only check for tests in suffixed files +python_files = *_test.py