JamesHutchison / pytest-hot-reloading

A hot reloading pytest daemon, implemented as a plugin
MIT License
86 stars 2 forks source link

Only call jurigged.watch once #70

Closed JamesHutchison closed 8 months ago

JamesHutchison commented 8 months ago

Noticed very high CPU usage using poll vs watchman. Looking at the code, it appears to create a new watcher every time watch is called, so this modifies the jurigged usage to only call watch once and then updates the registry used by the watcher.

The latest code update aligned the usage of watch so that polling was, by default, used for all files. Previously it was mixing poll and using the default of watchman. Tests and conftest files are automatically watched, so the use of watchman was hiding this inefficiency. Switching them to poll brought this out.

JamesHutchison commented 7 months ago

Related to #16