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

rich-kite-32423

12/30/2022, 8:08 PM
Does Pants pay attention to the
conftest.py
file, or any part of it? Thanks...
b

bitter-ability-32190

12/30/2022, 8:09 PM
Can you be more specific? šŸ™‚ Pants is aware of conftest files (see
python_test_utils
target) and auto-infers them up the chain
r

rich-kite-32423

12/30/2022, 8:11 PM
In particular the
collect_ignore
list.
f

fresh-cat-90827

12/30/2022, 9:49 PM
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
14 Views