Does Pants pay attention to the `conftest.py` file...
# general
r
Does Pants pay attention to the
conftest.py
file, or any part of it? Thanks...
b
Can you be more specific? šŸ™‚ Pants is aware of conftest files (see
python_test_utils
target) and auto-infers them up the chain
r
In particular the
collect_ignore
list.
f
I don't think so. The collect_ignore docs. I've created a minimal repro here: https://github.com/AlexTereshenkov/example-python/pull/2/files with `collect_ignore = ["translator"]`:
Copy code
$ ./pants --no-local-cache test ::
āœ“ helloworld/greet/greeting_test.py:tests succeeded in 0.20s.
āœ“ helloworld/translator/translator_test.py:tests succeeded in 0.17s.

$ pytest helloworld               
=================================================================================================== test session starts ===================================================================================================
platform linux -- Python 3.10.8, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/alexey.tereshenkov/code/example-python
collected 2 items                                                                                                                                                                                                         

helloworld/greet/greeting_test.py ..                                                                                                                                                                                [100%]

==================================================================================================== 2 passed in 0.09s ====================================================================================================
I am afraid you'd have to pass arguments to
pytest
to filter the tests, please see https://www.pantsbuild.org/docs/reference-pytest#args