Comments (6)
👍 for tests. Pretty amusing that a testing tool has no tests, huh?
I don't think we need anything heavy though. We don't necessarily need randomized data to test the wire-up the ptw provides. All we really need is a tests/
directory with a few test_xx.py
files and subdirectories that mimic real projects (e.g. some that include a pytest.ini
to ensure that the config wire-up is working). It's boring, but it works.
from pytest-watch.
To clear myself, I didn't mean filling those files with randomised data, but more like filling necessary files like pytest.ini in a declarative manner, as possible in cloud-init.
Something like this
-tests/test_asd.py
-asd.py
-pytest.ini
content:
[pytest-watch]
verbose = True
We can do it with just Python too, but I think that will be pretty boring, error-prone and more likely, we'll end up writing half-baked helpers for this. It is better that we choose a well-tested soln for this.
from pytest-watch.
What advantage does that have over a literal file that contains the same thing?
tests/test-project/pytest.ini:
[pytest-watch]
verbose = True
from pytest-watch.
Closing this because there's already an issue for tests and I don't plan to have any generated directories as of right now. I think having a directory of test projects is more stable, visible, and just as declarative as putting the same information into a config file.
On the other hand, the downside to having literal files instead of generated ones is that you can't combine cases as easily. I don't think it's a big advantage in this particular project since we can cover most ptw cases with just a few test projects. But if does become unwieldy, I'm definitely willing to use tools to help. Using them from the get-go is just too much of a pre-optimization.
Thanks for the suggestion, @bendtherules.
from pytest-watch.
You are right that it doesnt make much of a difference. I was just thinking that it will help generate the structure in a temporary directory to make sure improper tests dont dirty the actual directories, but maybe we can just copy it over to get the same effect.
from pytest-watch.
@bendtherules Oh yes, that's a good point. The technique I've been using is to use temp directories for that purpose, copying files over like you're suggesting. Not all tests will require file changes though, so some tests can function without the extra overhead. Luckily, git will let us see if we accidently set up tests that write to those "read-only" directories.
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.