You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 05_testing_and_ci/python_testing_demo.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,8 +49,8 @@ tests/
49
49
-`unittest.main()` provides an option to run the tests from a command-line interface and also from a file.
50
50
-`setUp` function is executed before all the tests. Similar a clean up function `tearDown` exists.
51
51
- The intention is to group together sets of similar tests in an instant of `unittest.TestCase` and have multiple such instances.
52
+
- A unit test for the function `find_median` is written by mocking the function `reorder_data` using [MagicMock](https://docs.python.org/3/library/unittest.mock.html#magic-mock) from unittest. The function `reorder_data` is mocked so that the function `find_median` can be tested in isolation.
52
53
- Decorators such as `@unittest.skip`, `@unittest.skipIf`, `@unittest.expectedFailure` can be used to gain flexibility over working of tests.
53
-
-`unittest.TestCase.subTest` can be used to distinguish parameters inside the body of a test.
0 commit comments