Comments (18)
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.
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.
What editor are you using?
It might create a temporary file first, and then move it etc.
from pytest-watch.
Just VIM. backupdir
, undodir
and a directory
settings are all located in the subderictories under ~/.vim/. So they shouldn't interfear.
from pytest-watch.
@joeyespo Seems like the same problem I've been seeing :)
from pytest-watch.
@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.
@blueyed @Glueon I already fixed it a few hours ago in #11 PR
from pytest-watch.
@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.
@Glueon
Have you tried the code from #11 branch (it hasn't been merged into master yet)?
from pytest-watch.
@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.
Yep, that's caused by atomic saves, hence we have to spool events manually
from pytest-watch.
@joeyespo As soon as these changes get merged you can close this issue.
from pytest-watch.
Great!
@Glueon
It's related to Vim's backupcopy
setting. You could use set backupcopy=yes
.
from pytest-watch.
This will reduce 3 events to 1?
Thanks.
from pytest-watch.
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.
@blueyed That's a fantastic reference. Thanks!
from pytest-watch.
@Glueon Merged! Thanks for opening the issue.
from pytest-watch.
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)
- broken link in the README: saythanks
- How to use with poetry? HOT 3
- Run ptw with -s HOT 3
- pytest watch seems to fail when pyproject.toml is used as a config file HOT 7
- Logging error when running pytest in pytest-watch HOT 1
- Integration with pytest-cov HOT 2
- My ptw doesn't "watch" subdirectories
- Running from "python -m pytest_watch" does not add current path to PYTHONPATH HOT 1
- ignore `Client.dataset is deprecated` warnings
- Maintenance Status? HOT 4
- pytest 7.0: AttributeError: 'dict' object has no attribute 'config' HOT 3
- error:'str' object has no attribute 'plate_num'
- Specify `python_requires` in the distribution package metadata
- Runner argument not parsed correctly on windows
- Error in Python 3.10: `module 'collections' has no attribute 'MutableSet'` HOT 5
- `ImportError` when running tests using `ptw` HOT 2
- Directories passed to pytest-watch are also passed to pytest, but shouldn't be
- sdist is missing LICENSE
- When I install pytest-watch with Python 3.11 and pip 22.3.1 I see deprecation warning HOT 1
- GO TO PYTEST-WATCHER HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-watch.