[Freedombox-discuss] Heavy tests
Sunil Mohan Adapa
sunil at medhas.org
Sat Sep 11 03:07:41 BST 2021
On 10/09/21 4:02 pm, Fioddor Superconcentrado wrote:
> I've coded some tests that result too heavy (slow) for unit testing. But
> I think they still provide value in specific cases.
>
> So I've thought of renaming the file as *heavy_test_*.py*. This will
> make default calls skip them but they can still be run explicitly
> whenever the developer/tester wants to extend the coverage or the
> reliability of the tests.
>
> I'd like to know what other developers/testers think of this approach.
>
> If we do this for other modules and components we might create a
> subfolder 'heavy_tests' or similar to collect separate them from regular
> *tests_*.py* files.
>
It might be preferable to use pytest's "marks" to mark heavy tests (see
WordPress' functional tests for example on how to mark). Then, we can
introduce a '--include-heavy' option to include these tests (see
/conftest.py for example on how --include-functional is done). This
method gives us the flexibility organize tests via modules as we
currently do and easily mark them as heavy to avoid them during regular
runs.
--
Sunil
More information about the Freedombox-discuss
mailing list