diff options
author | Leo <thinkabit.ukim@gmail.com> | 2020-03-16 02:48:47 -0300 |
---|---|---|
committer | Leo <thinkabit.ukim@gmail.com> | 2020-04-02 01:43:47 +0000 |
commit | aad2afe051973fa7fd6f4f9b83703c09445ff17c (patch) | |
tree | 4266144bb0c3984f784b0dd910d33fa98a72c353 /community/py3-nose/coverage4-compat.patch | |
parent | aad758e364da9a69d0d519b619cc6eb2c7d150f8 (diff) |
community/py3-*: move from main/ and modernize
Diffstat (limited to 'community/py3-nose/coverage4-compat.patch')
-rw-r--r-- | community/py3-nose/coverage4-compat.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/community/py3-nose/coverage4-compat.patch b/community/py3-nose/coverage4-compat.patch new file mode 100644 index 00000000000..e77a080f24b --- /dev/null +++ b/community/py3-nose/coverage4-compat.patch @@ -0,0 +1,41 @@ +From: Dmitry Shachnev <mitya57@gmail.com> +Date: Wed, 29 Jun 2016 13:15:16 +0300 +Subject: [PATCH] Make coverage plugin compatible with Coverage.py 4.1 + +According to the Coverage.py 4.1 changelog: + +- The `Coverage.report` function had two parameters with non-None defaults, + which have been changed. `show_missing` used to default to True, but now + defaults to None. If you had been calling `Coverage.report` without + specifying `show_missing`, you'll need to explicitly set it to True to keep + the same behavior. + +Without that option, four tests in nose fail: + +- test_coverage_plugin.TestCoverageMinPercentagePlugin +- test_coverage_plugin.TestCoverageMinPercentageSinglePackagePlugin +- test_coverage_plugin.TestCoverageMinPercentageSinglePackageWithBranchesPlugin +- test_coverage_plugin.TestCoveragePlugin + +Patch-Source: https://github.com/nose-devs/nose/pull/1004 + +--- a/nose/plugins/cover.py ++++ b/nose/plugins/cover.py +@@ -187,7 +187,7 @@ + for name, module in sys.modules.items() + if self.wantModuleCoverage(name, module)] + log.debug("Coverage report will cover modules: %s", modules) +- self.coverInstance.report(modules, file=stream) ++ self.coverInstance.report(modules, file=stream, show_missing=True) + + import coverage + if self.coverHtmlDir: +@@ -207,7 +207,7 @@ + # make sure we have minimum required coverage + if self.coverMinPercentage: + f = StringIO.StringIO() +- self.coverInstance.report(modules, file=f) ++ self.coverInstance.report(modules, file=f, show_missing=True) + + multiPackageRe = (r'-------\s\w+\s+\d+\s+\d+(?:\s+\d+\s+\d+)?' + r'\s+(\d+)%\s+\d*\s{0,1}$') |