Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for shadowed tests with Pylint #1934

Merged
merged 2 commits into from
Apr 19, 2019

Conversation

Zac-HD
Copy link
Member

@Zac-HD Zac-HD commented Apr 18, 2019

Tests are often developed by a copy-paste-modify method - but we forget to change the function (or method) name, the earlier test is silently redefined and can never be run. This is obviously bad.

Since it turns out that the redefinition problem does actually happen, this PR adds Pylint to our CI just to run the function-redefined check. It also fixes the several test suite bugs that this detects, and restructures the false-positives to make this check as useful as possible.

I'm not running it over the source in CI, but did check each location by hand - there are multiple places where we really do want to redefine the function, and the remainder are due to pylint-dev/pylint#2239 (@typing.overload needs but does not yet have special handling).

@Zac-HD Zac-HD added the tests/build/CI about testing or deployment *of* Hypothesis label Apr 18, 2019
@Zac-HD Zac-HD merged commit a0a0377 into HypothesisWorks:master Apr 19, 2019
@Zac-HD Zac-HD deleted the dedupe-tests branch December 8, 2019 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests/build/CI about testing or deployment *of* Hypothesis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants