From eae3d8661bfadfc29c1ba969acc5b2d884c567b2 Mon Sep 17 00:00:00 2001 From: Ben Waugh Date: Wed, 10 Apr 2013 21:13:47 +0100 Subject: [PATCH] Finish cheat sheet section on how Nose finds tests. --- testing/cheat-sheet.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/testing/cheat-sheet.md b/testing/cheat-sheet.md index d8b9fdb..295801d 100644 --- a/testing/cheat-sheet.md +++ b/testing/cheat-sheet.md @@ -25,6 +25,8 @@ Alternatively, raise an exception to indicate what the problem is: Unittest -------- +TODO: write this section + * extending TestCase * assertions, e.g. self.assertEquals @@ -36,9 +38,13 @@ To run tests, at the shell prompt, type nosetests -TODO: finish this +By default, Nose will + +* look for test functions that have a name starting with `test` +* look for them in files with names starting with `test` +* look for such files in the current working directory, and in subdirectories with names starting with `test` -By default, Nose will find tests in files named `test_*`. +There are some additional rules, and you can configure your own, but this should be enough to get started. ### A simple test @@ -66,6 +72,3 @@ TODO: * setup... * per-test fixtures with @with_setup decorator - - - -- 2.26.2