Comments (8)
FYI Released pytest-watch 3.0.0 today, which includes --poll
.
Be sure to pip install --upgrade pytest-watch
😃
from pytest-watch.
Hi, @carsongee. Perhaps.
Actually, do you think this is a watchdog
bug? If the files are indeed changing, watchdog should pick it up regardless if it's running in a container or not. Or am I misunderstanding?
from pytest-watch.
I just checked their repo, and found a very similar issue: gorakhargosh/watchdog#283. So it isn't really designed to handle events on remote file systems like we have with mounted container volumes since it is just using kernel events, so if you run watchdog in the container, since the kernel in the container isn't firing the event, the one in the host OS is, the watchdog can't react to it.
from pytest-watch.
Good find!
Looks like watchdog provides a decent workaround with PollingObserver
.
It'd be great it watchdog was able to detect whether inotify
was reliable or not, so you wouldn't need an application-level concern. This is, in my opinion, a leaky abstraction that watchdog could potentially plug up. (Interested in opening a new issue asking for them to look into this? Docker is indeed growing in popularity.)
We could look at other libraries to see if they work inside of Docker out-of-the-box so pytest-watch users don't have to waste any time with this surprise. In the short-term, adding an option to use polling should be ok. I'd happily pull in a PR if you wanted to add a --poll
option.
from pytest-watch.
I added the PR. As to reporting it upstream, are you thinking the issue would be to have the standard observer figure out if it needs to use polling? That would be pretty cool. I don't think there is any other way to address it in watchdog since the nature of remote filesystems is not to generate kernel events, that would have to be a fix in Mac and Linux kernels I think, but I'm a little out of my depth on this.
from pytest-watch.
are you thinking the issue would be to have the standard observer figure out if it needs to use polling
Exactly. Then all tools that use watchdog would just work under this scenario instead of having to implement their own custom solutions.
I believe it's possible. For instance, one (bad) way would be to have watchdog create a .watchdog
file and delete it right away in the directory it's observing. If no kernel events happen, turn on polling.
from pytest-watch.
from pytest-watch.
@carsongee Thank you!
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.