From: Ben Waugh Date: Fri, 12 Apr 2013 09:53:26 +0000 (+0100) Subject: Tidy section on other assertions in Nose. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6dc237f318b9bdaf9c5a01bff8b33bf63b98ac9f;p=swc-testing-nose.git Tidy section on other assertions in Nose. --- diff --git a/python/testing/cheat-sheet.md b/python/testing/cheat-sheet.md index 0d6eac8..65c521b 100644 --- a/python/testing/cheat-sheet.md +++ b/python/testing/cheat-sheet.md @@ -60,12 +60,6 @@ There are some additional rules, and you can configure your own, but this should ### Other assertions Nose provides a range of assertions that can be used when a test is not just checking a simple equality, e.g. -* assertTrue, assertFalse -* assertIn, assertNotIn -* assertIs, assertIsNot -* assertRaises -* (what else?) - from nose.tools import assert_items_equal @@ -76,6 +70,12 @@ Nose provides a range of assertions that can be used when a test is not just che expected = [2, 3] assert_items_equal(observed, expected) # order of factors is not guaranteed +* assertTrue, assertFalse +* assertIn, assertNotIn +* assertIs, assertIsNot +* assertRaises +* (what else?) + ### Floating point tests When comparing floating-point numbers for equality, allow some tolerance for small differences due to