module
tests.python_package_example_test
This file contains examples of how to write tests using pytest!
Some good practices for writting great Python tests:
Source: https://www.nerdwallet.com/blog/engineering/5-pytest-best-practices/
- Prefer mocker over mock
- Parametrize the same behavior, have different tests for different behaviors
- Don’t modify fixture values in other fixtures
- Prefer responses over mocking outbound HTTP requests
- Prefer tmpdir over global test artifacts
Functions
test_divide_error
(
a
,b
,expected
)
— Check if divide returns correct Exceptions for known entries.</>test_divide_ok
(
a
,b
,expected
)
— Check if divide works for expected entries.</>