Q9: what's the purpose of `python_test_utils` and ...
# general
r
Q9: what's the purpose of
python_test_utils
and how does it interact with
python_tests
?
2
r
r
is it possible to add other utility modules under the tests directory to be used with tests?
(which are not tests by themselves)
b
conftests
are funny because they aren't your natural python sources, but they also aren't tests themselves... therefore they gettheir own special target
is it possible to add other utility modules under the tests directory to be used with tests?
Anything is possible. Pants is just built with some conventions in mind, but you are welcome to override/amend the defaults as you need to
r
ahha
i got it
🙌 2
👖 1
1
now the test runs
b
Always a great feeling 😉
🙏 1
r
image.png
so the missing pieces were
//:reqs
dependency in
python_sources
and
redis/*.py
with
!redis/test_*.py
to specify test utility modules
it is interesting that it runs pytest modules one-by-one to parallelize
do i need to specify this line? it works same with/without the line.
r
you can try removing it and running the test 😉
r
it works without it, so i think pants automatically assumes
python_tests
relies on
python_test_utils
in the same BUILD file
👍 1
though I'd prefer explicity