Skip to content

Commit c08d48b

Browse files
[PATCH] More cleanup and regression fixes (- WIP #82 -)
1 parent 66c99dd commit c08d48b

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed

.coveragerc

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,48 @@
11
[run]
2+
concurrency = multiprocessing
23
parallel = True
4+
sigterm = True
5+
# enable if you want to consider branches in coverage
6+
# branch = True
37

48
[report]
5-
include = pythonrepo*,tests*
9+
include = pythonrepo/*,tests/*
610
# Regexes for lines to exclude from consideration
711
exclude_lines =
812
# Have to re-enable the standard pragma
913
pragma: no cover
14+
pass
15+
except ImportError
16+
except ModuleNotFoundError
1017
except Exception
11-
except BaseException:
18+
except BaseException
19+
except UnicodeDecodeError
1220
# Don't complain if tests don't hit defensive assertion code:
1321
raise AssertionError
1422
raise NotImplementedError
1523
raise ImportError
24+
raise ModuleNotFoundError
1625
except unittest.SkipTest
17-
except IOError
18-
except OSError
19-
26+
except ..Error
2027
# Don't complain if non-runnable code isn't run:
21-
if __name__ in '__main__':
28+
if __name__ .. .__main__.:
29+
if __name__ in u'__main__':
30+
if __name__ in u"__main__":
31+
os.abort()
32+
exit
2233

2334
ignore_errors = True
2435

36+
partial_branches =
37+
# Have to re-enable the standard pragma rules
38+
pragma: no branch
39+
skipcq: PYL-
40+
finally:
41+
@
42+
except unittest.SkipTest
43+
self.skipTest
44+
self.fail
45+
# Don't complain if non-runnable code isn't run:
46+
if __name__ in u'__main__':
47+
if __name__ in u"__main__":
48+
if __name__ in '__main__':

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ ifeq "$(COVERAGE)" ""
102102
# Only set COV_CORE_* variables when COVERAGE is configured
103103
ifneq "$(COVERAGE)" ""
104104
#COV_CORE_SOURCE = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/
105-
COV_CORE_CONFIG = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/.coveragerc
105+
COV_CORE_CONFIG = $(dir $(abspath $(firstword $(MAKEFILE_LIST)))).coveragerc
106106
COV_CORE_DATAFILE = .coverage
107107
endif
108108
endif
@@ -253,15 +253,15 @@ purge: legacy-purge
253253
$(QUIET)$(ECHO) "$@: Done."
254254

255255
test-reports: .env
256-
$(QUIET)mkdir $(INST_OPTS) $(dir $(abspath $(lastword $(MAKEFILE_LIST))))test-reports 2>$(ERROR_LOG_PATH) >$(ERROR_LOG_PATH) || true ;
257-
$(QUIET)$(BSMARK) $(dir $(abspath $(lastword $(MAKEFILE_LIST))))test-reports 2>$(ERROR_LOG_PATH) >$(ERROR_LOG_PATH) || true ;
256+
$(QUIET)mkdir $(INST_OPTS) $(dir $(abspath $(firstword $(MAKEFILE_LIST))))test-reports 2>$(ERROR_LOG_PATH) >$(ERROR_LOG_PATH) || true ;
257+
$(QUIET)$(BSMARK) $(dir $(abspath $(firstword $(MAKEFILE_LIST))))test-reports 2>$(ERROR_LOG_PATH) >$(ERROR_LOG_PATH) || true ;
258258
$(QUIET)$(ECHO) "$@: Done."
259259

260260
test-reqs: .env init cc-test-reporter test-reports
261261
$(QUIET)$(PYTHON) -m pip install $(PIP_COMMON_FLAGS) $(PIP_ENV_FLAGS) -r test-requirements.txt 2>$(ERROR_LOG_PATH) || true
262262

263263
just-test: cleanup
264-
$(QUIET)$(COVERAGE) run -p --source=pythonrepo -m unittest discover --verbose --buffer -s $(dir $(abspath $(lastword $(MAKEFILE_LIST))))tests -t $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) || $(PYTHON) -m unittest discover --verbose --buffer -s $(dir $(abspath $(lastword $(MAKEFILE_LIST))))tests -t $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) || DO_FAIL="exit 2" ;
264+
$(QUIET)$(COVERAGE) run -p --source=pythonrepo -m unittest discover --verbose --buffer -s $(dir $(abspath $(firstword $(MAKEFILE_LIST))))tests -t $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) || $(PYTHON) -m unittest discover --verbose --buffer -s $(dir $(abspath $(firstword $(MAKEFILE_LIST))))tests -t $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) || DO_FAIL="exit 2" ;
265265
$(QUIET)$(WAIT) ;
266266
$(QUIET)$(DO_FAIL) ;
267267

@@ -277,7 +277,7 @@ test-tox: cleanup
277277
$(QUIET)$(ECHO) "$@: Done."
278278

279279
test-pytest: cleanup MANIFEST.in test-reqs must_have_pytest test-reports
280-
$(QUIET)$(PYTHON) -m pytest --cache-clear --doctest-glob=pythonrepo/*.py --doctest-modules --cov=. --cov-append --cov-report=xml --junitxml=test-reports/junit.xml -v --rootdir=$(dir $(abspath $(lastword $(MAKEFILE_LIST)))) || DO_FAIL="exit 2" ;
280+
$(QUIET)$(PYTHON) -m pytest --cache-clear --doctest-glob=pythonrepo/*.py --doctest-modules --cov=. --cov-append --cov-report=xml --junitxml=test-reports/junit.xml -v --rootdir=$(dir $(abspath $(firstword $(MAKEFILE_LIST)))) || DO_FAIL="exit 2" ;
281281
$(QUIET)$(CC_TOOL) $(CC_TOOL_ARGS) 2>$(ERROR_LOG_PATH) || : ;
282282
$(QUIET)$(CA_TOOL) $(CA_TOOL_ARGS) || : ;
283283
$(QUIET)$(DS_TOOL) $(DS_TOOL_ARGS) || : ;

0 commit comments

Comments
 (0)