Closed
Bug 1193331
Opened 10 years ago
Closed 10 years ago
remove eq_ and ok_: suggest
Categories
(Input Graveyard :: Code Quality, defect)
Input Graveyard
Code Quality
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: willkg, Assigned: reachtotj, Mentored)
References
Details
We recently switched from nose to py.test. nose had helper functions eq_ and ok_ which we used extensively throughout the test suite. py.test doesn't need these since it does magic things with assert.
This bug covers removing eq_ and ok_ usage and replacing them with normal asserts in the fjord/suggest/ directory.
| Reporter | ||
Comment 1•10 years ago
|
||
Required skills:
* experience with Python
* ability to run the test suite
How to implement:
For each file in fjord/*/tests/, do the following:
1. remove eq_ and ok_ from the import list
2. go through the file converting eq_ and ok_ to appropriate assert lines
An eq_ example:
eq_(resp.status_code, 200)
This line verifies that the value of resp.status_code is 200. The equivalent assert statement is:
assert resp.status_code == 200
An ok_ example:
ok_(user.is_admin())
This line verifies that the value returned by the call user.is_admin() is True. The equivalent assert statement is:
assert user.is_admin()
You can read up on assert in the py.test docs:
http://pytest.org/latest/assert.html
I did the work for fjord/alerts/. You can see the commit here:
https://github.com/mozilla/fjord/commit/37cb87734570f15818061ac291f750931c896842
Marking this as a mentored bug. If you're interested in working on it,
please read through our "Join this project" guide [1], complete the
list of things you need to do before contributing and then add a comment
to this bug asking to have it assigned to you.
If you have any questions, please ask on the mailing list or in the
#input channel on irc.mozilla.org.
[1] http://fjord.readthedocs.org/en/latest/welcome.html
Mentor: willkg
| Reporter | ||
Comment 2•10 years ago
|
||
Assigning these all to reachtotj since he's cruised through the last couple.
Assignee: nobody → reachtotj
| Reporter | ||
Comment 3•10 years ago
|
||
In a PR: https://github.com/mozilla/fjord/pull/651
Landed in master: https://github.com/mozilla/fjord/commit/b5cdb90fa7a15511ea020755792bf95b12d4e2bc
This only affects tests and nothing needs to be deployed. Marking as FIXED.
Thank you!
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 4•10 years ago
|
||
Oops--I shouldn't have closed this. There are still eq_ and ok_ uses in fjord/suggest/providers/sumo/tests/test_sumosuggest.py .
Can you do those, too?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Ohh I was looking under main tests directory. I will fix this and take care from the next time
| Reporter | ||
Comment 6•10 years ago
|
||
sumosuggest provider tests in PR: https://github.com/mozilla/fjord/pull/654
Landed in master: https://github.com/mozilla/fjord/commit/47d6380313d010a18621b4d344d01792003d04c9
I double-checked the fjord/suggest/ directory tree for eq_ and ok_ and we're good to go.
Since this is specific to the tests and doesn't affect servers, I'm going to mark this FIXED.
Thank you, again!
Status: REOPENED → RESOLVED
Closed: 10 years ago → 10 years ago
Resolution: --- → FIXED
Updated•9 years ago
|
Product: Input → Input Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•