Skip to content

Assert greater#131

Open
jonmcoe wants to merge 2 commits intoclips:masterfrom
jonmcoe:assert-greater
Open

Assert greater#131
jonmcoe wants to merge 2 commits intoclips:masterfrom
jonmcoe:assert-greater

Conversation

@jonmcoe
Copy link
Copy Markdown

@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