pytest-watch: Loops endlessly after one change was detected in Boxcryptor environment
I just tried this on my project and it looks good initially. However, once I update any file (i.e. re-save), pytest-watch just performs test after test after test … until I ctrl-c.
It should definitely not do that.
There is either a loop in the tool itself or it detects changes to files that are generated during the build process and thus always attempts to rebuild.
The latter is unlikely however since it does not start looping until the very first change is detected. Furthermore, I checked which files had changed in the directory since the “original” run of pytest-watch and it was only the file I actually did change and its corresponding __pycache__/*.pyc file. And that file is very likely not regenerated if the source file didn’t change either.
It would be nice if the changed file was displayed in the console before the command is rerun.
Environment: Windows7, Python 3.5.0 (64-bit), pytest 2.8.3, py 1.4.31, pytest-watch 3.8.0, watchdog 0.8.3
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 22 (13 by maintainers)
Fascinating.
These files keep on emitting
FileModifiedEventevents from Watchdog:And sometimes:
Maybe Boxcryptor really is touching these files when Python imports them from disk. I think I found a related issue on the forums.
Can you try these?
Polling
This does a manual check for differences instead of using OS events. If Boxcryptor is opening the files in a way that causes the OS to generate a
modifiedevent, but doesn’t actually change anything on the file, this might work.Spooling
This will wait 5 seconds before re-running when changes are detected. If Boxcryptor takes time to sync files before it updates the mod time, and accessing the file during this time invalidates the syncing, this might work.
Thanks for continuing to try things!