remove eq_ and ok_: redirector



3 years ago
2 years ago


(Reporter: willkg, Assigned: reachtotj, Mentored)



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/redirector/ directory.
Blocks: 1193335
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:


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:

I did the work for fjord/alerts/. You can see the commit here:

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

Mentor: willkg
Assigning these all to reachtotj since he's cruised through the last couple.
Assignee: nobody → reachtotj
In a PR:

Landed in master:

This only touched tests, so there's nothing to deploy. Marking as FIXED.

Thank you!
Last Resolved: 3 years ago
Resolution: --- → FIXED
Product: Input → Input Graveyard
You need to log in before you can comment on or make changes to this bug.