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

lively-dusk-46231

10/24/2022, 3:21 PM
When figuring out caches in pytest runs Does pants only use the file based dependency ? Or does it use the coverage to figure out which lines of code were run by a testcase, and return the testcase only if those lines of code were modified (something like pytest-testmon)
h

happy-kitchen-89482

10/24/2022, 3:22 PM
It all happens at the transitive file level.
There is no introspection inside a test file, and no use of coverage to filter tests
l

lively-dusk-46231

10/24/2022, 3:25 PM
đź‘Ť got it - thanks Any plans to go inside a test file ? Is it in scope for pants at all - i.e. should I create a feature request in github ? PS: In my company (for what ever reason) we have 5k lines in each test file. Which translates to about 100ish testcases (a lot of them with
pytest.mark.parameterize
) We could break this into smaller files which I do think can clean stuff up
h

happy-kitchen-89482

10/24/2022, 3:38 PM
Our first recommendation would definitely be to break up test files, this will make life easier not just with respect to Pants usage but in general…
But you can definitely file a feature request. It would be no small amount of work though.
h

hundreds-father-404

10/24/2022, 4:20 PM
I remember at Pycon 2021 the Typing Summit had an interesting talk about caching at the symbol level, e.g. functions. It was very advanced stuff - it would be cool if Pants eventually got there, although I suspect this might not happen for some time
b

bitter-ability-32190

10/24/2022, 5:02 PM
While we're brainstorming.
mypy
has an "interface hash" 🤔
5 Views