Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

feat: move tests to pytest #1042

Merged
merged 1 commit into from
Oct 12, 2017
Merged

feat: move tests to pytest #1042

merged 1 commit into from
Oct 12, 2017

Conversation

jrconlin
Copy link
Member

@jrconlin jrconlin commented Oct 10, 2017

Issue #1039

General sweep of tests to make things "pytest" compliant. This means switching nosetool calls for their assert/pytest primatives.

Note, there were a few tests in test_cryptokey that were invalid and have been fixed because of this.
In addition, some light type correction was made where appropriate.

(Also note: this PR does not fully close #1039. tox and other functions still use nose.)

@codecov-io
Copy link

codecov-io commented Oct 10, 2017

Codecov Report

Merging #1042 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1042      +/-   ##
==========================================
+ Coverage   99.76%   99.76%   +<.01%     
==========================================
  Files          55       55              
  Lines        8820     8823       +3     
==========================================
+ Hits         8799     8802       +3     
  Misses         21       21
Impacted Files Coverage Δ
autopush/db.py 100% <ø> (ø) ⬆️
autopush/tests/test_log_check.py 100% <100%> (ø) ⬆️
autopush/tests/test_web_validation.py 100% <100%> (ø) ⬆️
autopush/tests/test_router.py 100% <100%> (ø) ⬆️
autopush/tests/test_health.py 100% <100%> (ø) ⬆️
autopush/tests/test_endpoint.py 100% <100%> (ø) ⬆️
autopush/tests/test_diagnostic_cli.py 100% <100%> (ø) ⬆️
autopush/tests/test_main.py 100% <100%> (ø) ⬆️
autopush/tests/test_metrics.py 100% <100%> (ø) ⬆️
autopush/tests/test_db.py 100% <100%> (ø) ⬆️
... and 7 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 369bcbc...774948f. Read the comment docs.

@jrconlin jrconlin force-pushed the bug/1033 branch 6 times, most recently from bf49f0c to 77348cb Compare October 12, 2017 18:18
bbangert
bbangert previously approved these changes Oct 12, 2017
eq_(exc.status_code, 201)
eq_(len(self.metrics.increment.mock_calls), 0)
ok_("Location" in exc.headers)
assert exc, RouterResponse
Copy link
Member

Choose a reason for hiding this comment

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

I'm noticing a few of these asserts (originally ok_s) are incorrect. This and a couple others should be assert isinstance(exc, RouterResponse). A couple "assert status.status_code, 201" below.

Logged a separate issue here:

#1043

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I had to correct a few of those. Good catch on these. I'll clean them up.

@@ -0,0 +1,11 @@
from autopush.tests import setUp, tearDown
Copy link
Member

Choose a reason for hiding this comment

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

can we move conftest into tests/ ? (it usually lives there, in my experience)

@pjenvey pjenvey merged commit e615508 into master Oct 12, 2017
@pjenvey pjenvey deleted the bug/1033 branch October 12, 2017 23:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider moving autopush to newer testing schema
4 participants