https://pantsbuild.org/ logo
#general
Title
# general
r

rapid-exabyte-76685

04/06/2022, 5:27 AM
I might have to create multiple
python_tests
targets with
name=test_unit
and
name=test_integration
plus tags and explicitly add the test modules to each target, as the solution for moment?
Copy code
python_tests(
  name="tests",
  sources=["test_*.py", "!test_an_integration_test.py"]
)

python_tests(
  name="integration_tests",
  sources=["test_an_integration_test.py"],
  tags=["integration_tests"]
)
And then running unit tests/integration tests explicitly becomes...
Copy code
# run unit tests
./pants -tag=-integration_tests test :: -- -m "not integration"

# run integration tests
./pants -tag=integration_tests test :: -- -m "integration"