@@ -351,11 +351,11 @@ It is common practice to import and alias all of a library, such as
351351` import numpy as np ` . However, as we develop our unit tests, this can cause
352352difficulty with mocking, and complicate refactoring.
353353
354- To patch out ` numpy.sum ` in your test, you either need to patch the _ global_ numpy
355- module, which can have unintended side-effects, or specifically patch numpy.sum
356- within the module namespace, which can result in absurdly long namespace paths,
357- and logical breaks in the path when we transition from the local module
358- namespace into an imported dependency's namespace, like so:
354+ To patch out ` numpy.sum ` in your test, you either need to patch the _ global_
355+ numpy module, which can have unintended side-effects, or specifically patch
356+ numpy.sum within the module namespace, which can result in absurdly long
357+ namespace paths, and logical breaks in the path when we transition from the
358+ local module namespace into an imported dependency's namespace, like so:
359359
360360``` python
361361def test_func (mocker ):
@@ -395,15 +395,14 @@ total = numeric_sum(some_numeric_values)
395395
396396We recommend using Pytest for running tests in your development environments. To
397397run unit tests in your source folder, from your package root, use
398- ` pytest {path/to/source} ` .
399- To run tests from an installed package (outside of
398+ ` pytest {path/to/source} ` . To run tests from an installed package (outside of
400399your source repository), use ` pytest --pyargs {package name} ` .
401400
402- You can set the default test path in ` pyproject.toml ` , see:
403- [ Configuring pytest] ({% link pages/tutorials/test.md %}#configuring-pytest)
404-
405- We recommend configuring pytest to run ONLY your fastest, least demanding test suite by default.
401+ You can set the default test path in ` pyproject.toml ` , see: [ Configuring
402+ pytest] ({% link pages/tutorials/test.md %}#configuring-pytest)
406403
404+ We recommend configuring pytest to run ONLY your fastest, least demanding test
405+ suite by default.
407406
408407#### Mocking and Patching to Isolate the code under test
409408
0 commit comments