You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run my test suite, I get this output at the end:
=============== inline snapshot ====================
Info: 11 snapshots can be trimmed (--inline-snapshot=trim)
From the docs:
trim removes every snapshots form the storage which is not referenced with external(...) in the code.
However if I run pytest with --inline-snapshot=trim it doesn't do anything. I have 11 external files indeed, so I suspect inline-snapshot doesn't detect external calls in my code:
Can't reproduce while debugging. external calls are correctly identified. Maybe an issue with pytest-xdist again. UPDATE: yep, no such message when disabling pytest-xdist.
Quick thought: if inline-snapshot finds uses of external by searching in the files collected by the current pytest process, then it's possible that one of the process didn't run a single test from my module using external, and therefore inline-snapshot finds no reference to the existing snapshots. A solution would be to somehow check every test file used across the run (multiple process through xdist). Or maybe even all tests file, period, because if I unselect tests using external, that doesn't mean my snapshots are unused.
0.9.0 contains now a check if you use xdist at the same time.
I think there are several issues with the current implementation of outsource. I have some ideas how the DX could be improved and wrote it down (#86). Please tell me if you have some feedback.
When I run my test suite, I get this output at the end:
From the docs:
However if I run pytest with
--inline-snapshot=trim
it doesn't do anything. I have 11 external files indeed, so I suspect inline-snapshot doesn't detectexternal
calls in my code:The text was updated successfully, but these errors were encountered: