Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does testmon handle data files? #178

Open
uriva opened this issue Feb 24, 2022 · 1 comment
Open

How does testmon handle data files? #178

uriva opened this issue Feb 24, 2022 · 1 comment

Comments

@uriva
Copy link

uriva commented Feb 24, 2022

if I have in my code an open('path/to/file.json').read() command, would testmon be able to flag that file?

I saw there is something called file tracers in coverage but not sure if it is for this use case.

@tarpas
Copy link
Owner

tarpas commented Feb 24, 2022

No, testmon wouldn't be able to recognize file.json as a dependency of the code.

AFAIK coverage is and will always deal with executable files and lines but not I/O.

https://coverage.readthedocs.io/en/6.0.2/api_plugin.html#file-tracers can be implemented but they are intended for things like yml file with instructions or django templates...

There are a couple of possible solutions for your use case but all the realistic ones include manual declaration of the dependency of tests to input files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants