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

Prefer unittest.mock but require mock for python < 3.3. #221

Merged
merged 1 commit into from
Nov 28, 2017

Conversation

jlitzingerdev
Copy link
Contributor

The unit tests require mock but don't specify it, which causes
problems for any usages outside tox (e.g. testing that changes to
twisted don't break klein). Use PEP508 to specify environment markers
and only install mock when required. Tests can then conditionally
import unittest.mock and fall back to mock.

The conditional imports do raise a mypy error, discussed here:
python/mypy#1153

So an annotation is required to silence this specific warning.

The unit tests require mock but don't specify it, which causes
problems for any usages outside tox (e.g. testing that changes to
twisted don't break klein).  Use PEP508 to specify environment markers
and only install mock when required.  Tests can then conditionally
import unittest.mock and fall back to mock.

The conditional imports do raise a mypy error, discussed here:
    python/mypy#1153

So an annotation is required to silence this specific warning.
@codecov
Copy link

codecov bot commented Nov 17, 2017

Codecov Report

Merging #221 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #221      +/-   ##
=========================================
+ Coverage   95.89%   95.9%   +0.01%     
=========================================
  Files          12      12              
  Lines        1558    1564       +6     
  Branches       86      86              
=========================================
+ Hits         1494    1500       +6     
  Misses         52      52              
  Partials       12      12
Impacted Files Coverage Δ
src/klein/test/test_app.py 98.57% <100%> (+0.02%) ⬆️
src/klein/test/test_resource.py 96.9% <100%> (+0.01%) ⬆️

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 61c0661...adc6341. Read the comment docs.

@wsanchez
Copy link
Member

Looks good, thanks!

@wsanchez wsanchez merged commit 1f2bc3b into twisted:master Nov 28, 2017
@wsanchez
Copy link
Member

wsanchez commented Mar 3, 2018

Fixes #166

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