From fe1ae7ea6647167b4e74a15039026d64f16e5de7 Mon Sep 17 00:00:00 2001 From: Michal Petrik Date: Sat, 30 Apr 2022 13:17:18 +0200 Subject: [PATCH] Update 55_tests.md --- website/content/07_programs_libraries_modules/55_tests.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/content/07_programs_libraries_modules/55_tests.md b/website/content/07_programs_libraries_modules/55_tests.md index e481cb9..63ac14f 100644 --- a/website/content/07_programs_libraries_modules/55_tests.md +++ b/website/content/07_programs_libraries_modules/55_tests.md @@ -68,7 +68,7 @@ def multiply(x, y): return x * y ``` -Easy enough. Let's write a test case for it. Usually this will be broken out into a separate file, but we'll combine them for this contrived example. We'll create a `TestMultiply` class that derives from `unittest.TestCase`, with a method inside that does the actual testing. Lastly, we'll call `unittest.main()` to tell `unittest` to find and run our TestCase. We'll put all this in a file called `test_multiply.py` and run it from the command line: +Easy enough. Let's write a test case for it. Usually this will be broken out into separate files, but we'll combine them for this contrived example. We'll create a `TestMultiply` class that derives from `unittest.TestCase`, with a method inside that does the actual testing. Lastly, we'll call `unittest.main()` to tell `unittest` to find and run our TestCase. We'll put all this in a file called `test_multiply.py` and run it from the command line: ```python # test_multiply.py @@ -218,4 +218,4 @@ Subclassing the TestCase class gives you a bunch of useful assertions that you c ### Growing your Tests -Standard `unittest` tests are fine for most projects. As your programs grow and organization becomes more complex, you might want to consider an alternative testing framework or test runner. The 3rd party `nose2` and `pytest` modules are compatible with `unittest` but do things slightly differently. You can find more information in the [nose2 documentation](https://nose2.readthedocs.io/en/latest/) and [pytest documentation](https://docs.pytest.org/en/latest/). \ No newline at end of file +Standard `unittest` tests are fine for most projects. As your programs grow and organization becomes more complex, you might want to consider an alternative testing framework or test runner. The 3rd party `nose2` and `pytest` modules are compatible with `unittest` but do things slightly differently. You can find more information in the [nose2 documentation](https://nose2.readthedocs.io/en/latest/) and [pytest documentation](https://docs.pytest.org/en/latest/).