When figuring out caches in pytest runs Does pants...
# general
l
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
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
đź‘Ť 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
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
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
While we're brainstorming.
mypy
has an "interface hash" 🤔