Skip to content

[cherry-pick to master] Add rudimentary mypy type checking #5583

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

Merged
merged 1 commit into from
Jul 10, 2019
Merged

[cherry-pick to master] Add rudimentary mypy type checking #5583

merged 1 commit into from
Jul 10, 2019

Conversation

asottile
Copy link
Member

@asottile asottile commented Jul 9, 2019

from #5575

Add a very lax mypy configuration, add it to tox -e linting, and
fix/ignore the few errors that come up. The idea is to get it running
before diving in too much.

This enables:

- Progressively adding type annotations and enabling more strict
  options, which will improve the codebase (IMO).

- Annotating the public API in-line, and eventually exposing it to
  library users who use type checkers (with a py.typed file).

Though, none of this is done yet.

Refs #3342.
@codecov
Copy link

codecov bot commented Jul 9, 2019

Codecov Report

Merging #5583 into master will increase coverage by 1.38%.
The diff coverage is 98.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5583      +/-   ##
==========================================
+ Coverage   94.73%   96.11%   +1.38%     
==========================================
  Files         117      117              
  Lines       25713    25725      +12     
  Branches     2493     2493              
==========================================
+ Hits        24359    24726     +367     
+ Misses       1036      695     -341     
+ Partials      318      304      -14
Impacted Files Coverage Δ
src/_pytest/tmpdir.py 100% <ø> (ø) ⬆️
src/_pytest/assertion/rewrite.py 96.11% <100%> (+0.03%) ⬆️
src/_pytest/capture.py 94.75% <100%> (+1.33%) ⬆️
src/_pytest/python_api.py 97.34% <100%> (+0.01%) ⬆️
src/_pytest/_code/source.py 91.42% <100%> (ø) ⬆️
testing/test_pdb.py 99% <100%> (+51.68%) ⬆️
testing/python/raises.py 94.48% <100%> (ø) ⬆️
src/_pytest/mark/structures.py 92.61% <100%> (+0.04%) ⬆️
src/_pytest/reports.py 95.07% <100%> (+0.02%) ⬆️
src/_pytest/fixtures.py 97.52% <100%> (ø) ⬆️
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 628ff4d...89dfde9. Read the comment docs.

@nicoddemus nicoddemus merged commit 2c402f4 into pytest-dev:master Jul 10, 2019
@asottile asottile deleted the cherry_pick_5575 branch July 10, 2019 13:47
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.

3 participants