Just been directed to this thread, my context is.....
# general
r
Just been directed to this thread, my context is...
Copy code
# pytest.ini

[pytest]
markers =
    integration: mark test as integration test
and various test modules that are marked as integration tests, and others that are just unit tests...
Copy code
# test_some_integration_tests.py

import pytest

pytestmark = pytest.mark.integration

def test_something():
  # some integration tests that rely on db resource
Copy code
# test_some_unit_tests.py

import pytest

# no marks

def test_something_else():
  # some unit tests that don't rely on any resources
and getting exit code 5 for both of these attempts to run tests...
./pants test :: -- -m "not integration"
-- i.e. just running "unit" tests All of the modules that contain
pytestmark = pytest.mark.integration
return exit code 5 due to
collecting ... collected x item / x deselected / 0 selected
if the unit tests pass, create db and other "expensive" resources in the CI and run integration tests...
./pants test :: -- -m "integration"
-- i.e. just running integration tests All of the modules that don't contain
pytestmark = pytest.mark.integration
also return exit code 5 for the same reason.