pytest-incremental icon indicating copy to clipboard operation
pytest-incremental copied to clipboard

Modification watcher

Open Glueon opened this issue 10 years ago • 6 comments

Hello, Very cool plugin, but is it possible to combine it with any plugin or add a function of automatic test rerun on file modifications?

I used https://github.com/joeyespo/pytest-watch but it does not accept --inc parameter.

Glueon avatar Jun 09 '15 00:06 Glueon

See also https://github.com/tarpas/testmon / tmon.py.

You can use watchdog or pyinotify to wrap it yourself.

blueyed avatar Jun 09 '15 06:06 blueyed

See issues and PR's of https://github.com/joeyespo/pytest-watch ... The passing of argument is beeing seriously worked on, so hopefully it lands soon.. I'll then hopefully just adopt that for testmon and remove tmon.py.

On Tue, Jun 9, 2015 at 8:00 AM, Daniel Hahler [email protected] wrote:

See also https://github.com/tarpas/testmon / tmon.py.

You can use watchdog or pyinotify https://github.com/seb-m/pyinotify to wrap it yourself.

— Reply to this email directly or view it on GitHub https://github.com/pytest-dev/pytest-incremental/issues/3#issuecomment-110234749 .

tarpas avatar Jun 09 '15 06:06 tarpas

Thanks for you suggestions, but I realized I can pass options via pytest.ini file. And it works.

The only thing bothering me is it sometimes reruns tests 2-3 times when the file the gets modified. But this is a pytest-incremental related question.

Glueon avatar Jun 09 '15 09:06 Glueon

@Glueon pytest-incremental used to have a watcher but it was lost in the last re-write. So this is something I definitely want to add. Please note that although blueyed is shown as a collaborator, simply recommending another plugin or telling you to wrap watchdog yourself is not my official position...

There are a few problems in using this plugin with pytest-watch so I am not sure this is the way to go. I will take a look on it...

schettino72 avatar Jun 10 '15 12:06 schettino72

there are future plans to add such a watch functionality in pytest, but it will happen sometime after pytest-cache is integrated in pytest core and pytest is son github

RonnyPfannschmidt avatar Jun 10 '15 12:06 RonnyPfannschmidt

I definetly wanted to say that this is not a pytest-incremental question. The xdist plugin with loop-fail also has the problem rerunning tests several times on file modification. I have posted an issue already. Maybe it has something to do with the fact I am running tests in a docker container on a code which is in a volume mounted to my host machine.

At the moment pretty ok with this.

Glueon avatar Jun 10 '15 14:06 Glueon