Skip to content

Ignore cache when producing reports - #6076

Merged
msullivan merged 3 commits into
python:masterfrom
mthuurne:coverage_ignore_cache
Dec 21, 2018
Merged

Ignore cache when producing reports#6076
msullivan merged 3 commits into
python:masterfrom
mthuurne:coverage_ignore_cache

Conversation

@mthuurne

Copy link
Copy Markdown
Contributor

I had to add a bit of functionality to the test runner, so command line tests can do multiple runs. That is in the first commit. The second commit contains the actual fix.

PythonCmdlineSuite uses DataDrivenTestCase, but inspects the test
case properties rather than calling runtest(). Therefore it could
parse tests with multiple steps, but during execution only one
step was run.
If the cache is used, coverage information will only be reported for
modules that were not in the cache.

Fixes python#5103

@msullivan msullivan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One requested change about how to make the changes to the test framework.

Otherwise looks great!

Comment thread mypy/test/testcmdline.py Outdated
for step in [1] + sorted(testcase.output2):
try:
test_python_cmdline(testcase, step)
except AssertionError as ex:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to tweak the message at creation time (like is done in testcheck.py), rather than depending on catching it and mucking around with the internals.

Instead of intercepting and altering the exception messages, the
step number is now inserted into the message when it is initially
constructed.
@msullivan
msullivan merged commit bb0017d into python:master Dec 21, 2018
@mthuurne
mthuurne deleted the coverage_ignore_cache branch December 21, 2018 00:50
hauntsaninja pushed a commit that referenced this pull request Jan 6, 2023
#6076 made report generation disable cache but we didn't document it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants