From 1049c1b69463f1acebc5b73fbdaf1a57bba3dc49 Mon Sep 17 00:00:00 2001 From: Ben Waugh Date: Fri, 12 Apr 2013 10:58:20 +0100 Subject: [PATCH] Replace partial list of Nose assertions with instructions for listing them in Python. --- python/testing/cheat-sheet.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/testing/cheat-sheet.md b/python/testing/cheat-sheet.md index 65c521b..36f3557 100644 --- a/python/testing/cheat-sheet.md +++ b/python/testing/cheat-sheet.md @@ -70,11 +70,11 @@ 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?) +To see the available assertions, and get help with them: + + import nose.tools + dir(nose.tools) # list assertions and other classes/functions + help(nose.tools.assert_set_equal) # get information about one of them ### Floating point tests -- 2.26.2