Git Product home page Git Product logo

Comments (18)

joeyespo avatar joeyespo commented on August 11, 2024

Interesting. Does it happen when not using the incremental plugin?

If incremental works by manipulating the files system, that could be why.

from pytest-watch.

Glueon avatar Glueon commented on August 11, 2024

Actually I realized it happens even if I use loopfail feature from xdist. The only difference is that with xdist I've never seen test reruning 3 time in a row :) If you use the same code base as xdist then maybe it's a xdists's bug.

from pytest-watch.

blueyed avatar blueyed commented on August 11, 2024

What editor are you using?
It might create a temporary file first, and then move it etc.

from pytest-watch.

Glueon avatar Glueon commented on August 11, 2024

Just VIM. backupdir, undodir and a directory settings are all located in the subderictories under ~/.vim/. So they shouldn't interfear.

from pytest-watch.

aldanor avatar aldanor commented on August 11, 2024

@joeyespo Seems like the same problem I've been seeing :)

from pytest-watch.

blueyed avatar blueyed commented on August 11, 2024

@Glueon
You could add a print(event) to ChangeHandler.on_any_event to see what happens. It appears to work fine for me - there's only one event for me:

<FileModifiedEvent: src_path='/tmp/foo/file'>

from pytest-watch.

aldanor avatar aldanor commented on August 11, 2024

@blueyed @Glueon I already fixed it a few hours ago in #11 PR

from pytest-watch.

Glueon avatar Glueon commented on August 11, 2024

@aldanor
Well seems that it's still an issue. As I said I am using docker-compose run --rm my_container pwt to run the tests. My code folder is mounted using volume from a host machine. So when I save a file in VIM it runs tests exactly 3 times.

I have added a print(event) statement. It fires up 6 events.
Also I looked the version and it still says 2.0.0 even after I installed it via pip specying git repo. And the example usage with new featues outputs usage promt ...

from pytest-watch.

aldanor avatar aldanor commented on August 11, 2024

@Glueon
Have you tried the code from #11 branch (it hasn't been merged into master yet)?

from pytest-watch.

Glueon avatar Glueon commented on August 11, 2024

@aldanor
Oh, snap. I thougt it's in the master branch.
Your version fires up 3 events: created, deleted and modified, but runs only once. These 3 event seem kind of strange, but as soon as it runs once I am totally ok with that.

from pytest-watch.

aldanor avatar aldanor commented on August 11, 2024

Yep, that's caused by atomic saves, hence we have to spool events manually

from pytest-watch.

Glueon avatar Glueon commented on August 11, 2024

@joeyespo As soon as these changes get merged you can close this issue.

from pytest-watch.

blueyed avatar blueyed commented on August 11, 2024

Great!

@Glueon
It's related to Vim's backupcopy setting. You could use set backupcopy=yes.

from pytest-watch.

Glueon avatar Glueon commented on August 11, 2024

@blueyed

This will reduce 3 events to 1?
Thanks.

from pytest-watch.

blueyed avatar blueyed commented on August 11, 2024

Just for reference: here is a list how different editors handle this: https://github.com/guard/guard/wiki/Analysis-of-inotify-events-for-different-editors

from pytest-watch.

joeyespo avatar joeyespo commented on August 11, 2024

@blueyed That's a fantastic reference. Thanks!

from pytest-watch.

joeyespo avatar joeyespo commented on August 11, 2024

@Glueon Merged! Thanks for opening the issue.

from pytest-watch.

joeyespo avatar joeyespo commented on August 11, 2024

FYI Released pytest-watch 3.0.0 today, which includes the merged changes from #11. Be sure to pip install --upgrade pytest-watch and let me know if something broke!

from pytest-watch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.