pytest-dev / pytest-incremental

py-test plugin: an incremental test runner
http://pytest-incremental.readthedocs.org
MIT License
42 stars 7 forks source link

Modification watcher #3

Open Glueon opened 9 years ago

Glueon commented 9 years ago

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.

blueyed commented 9 years ago

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

You can use watchdog or pyinotify to wrap it yourself.

tarpas commented 9 years ago

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 notifications@github.com 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 .

Glueon commented 9 years ago

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.

schettino72 commented 9 years ago

@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...

RonnyPfannschmidt commented 9 years ago

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

Glueon commented 9 years ago

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.