Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add run_tests.py and Makefile rule to run unit test discovery with co…
…verage via Hython. Test cleanup, no longer run coverage in each file.
- Loading branch information
1 parent
8c4a204
commit c3f77d1
Showing
15 changed files
with
163 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# .coveragerc to control coverage.py | ||
[run] | ||
branch = True | ||
source = | ||
ht.inline | ||
ht.pyfilter.manager | ||
ht.pyfilter.property | ||
ht.pyfilter.utils | ||
ht.pyfilter.operations.deepimage | ||
ht.pyfilter.operations.ipoverrides | ||
ht.pyfilter.operations.operation | ||
ht.pyfilter.operations.primaryimage | ||
ht.pyfilter.operations.zdepth | ||
ht.sohohooks.aovs.aov | ||
ht.sohohooks.aovs.manager | ||
|
||
omit = | ||
*tests* | ||
*__init__* | ||
|
||
[report] | ||
# Regexes for lines to exclude from consideration | ||
exclude_lines = | ||
# Have to re-enable the standard pragma | ||
pragma: no cover | ||
|
||
# Don't complain about missing debug-only code: | ||
def __repr__ | ||
if self\.debug | ||
|
||
# Don't complain if tests don't hit defensive assertion code: | ||
raise AssertionError | ||
raise NotImplementedError | ||
|
||
# Don't complain if non-runnable code isn't run: | ||
if 0: | ||
if __name__ == .__main__.: | ||
|
||
ignore_errors = True | ||
|
||
[html] | ||
directory = coverage_html_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,6 @@ $(CLOBBERDIRS): | |
.PHONY: subdirs $(CLOBBERDIRS) | ||
.PHONY: install clean clobber | ||
|
||
run-tests: | ||
hython bin/run_tests.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"""Discover and run unittests, with coverage.""" | ||
|
||
import coverage | ||
import unittest | ||
|
||
# Start the coverage reporting. | ||
cov = coverage.Coverage() | ||
cov.start() | ||
|
||
# Find and run tests | ||
loader = unittest.TestLoader() | ||
suite = loader.discover(".") | ||
runner = unittest.TextTestRunner() | ||
runner.run(suite) | ||
|
||
# Stop the coverage operation, generate reports. | ||
cov.stop() | ||
cov.save() | ||
cov.html_report() | ||
cov.xml_report() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.