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

Assert greater #131

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Assert greater #131

wants to merge 2 commits into from

Conversation

jonmcoe
Copy link

@jonmcoe jonmcoe commented Oct 18, 2015

Uses assertGreater instead of assertEqual where sensible for more descriptive failure messages.

Example: one of the sentiment metrics is failing just slightly short of desired value.

Before

(pattern)➜  test git:(master) ✗ nosetests test_en.py:TestSentiment
..F.....
======================================================================
FAIL: test_sentiment (test_en.TestSentiment)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jon/pattern/test/test_en.py", line 919, in test_sentiment
    self.assertTrue(A > 0.754)
AssertionError: False is not true

----------------------------------------------------------------------
Ran 8 tests in 42.755s

FAILED (failures=1)

After

(pattern)➜  test git:(assert-greater) nosetests test_en.py:TestSentiment
..F.....
======================================================================
FAIL: test_sentiment (test_en.TestSentiment)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jon/pattern/test/test_en.py", line 919, in test_sentiment
    self.assertGreater(A, 0.754)
AssertionError: 0.7526666666666667 not greater than 0.754

----------------------------------------------------------------------
Ran 8 tests in 42.709s

FAILED (failures=1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants