square-plumber-93436
01/10/2024, 11:37 PMcareful-address-89803
01/10/2024, 11:51 PMpython_tests
targets that specifically pull in integration_test.py
and is tagged "integration"
python_tests(
name="integration-tests",
sources=["integration_test.py"],
tags=["integration"],
)
I can then do fun things like have pytest automatically skip integration tests. Or you can have pants run (or skip) integration tests, either at the pants level ( pants --tag="integration" test ::
) or at the pytest level pants test :: -- -m "integration"
. You probably only need one of those, but I like the flexibility.
There are a few advantages one way or the other. Skipping with pytest is annoying because you can end up with collection errors if all tests are deselected and you need to add a fake empty test.square-plumber-93436
01/11/2024, 1:51 AM