Comments (5)
See test.common.utils.fails_with
; I'm also adding a similar decorator for "this test is for a deprecated thing" as part of #599.
from hypothesis.
I think this issue was actually about making fails part of the public API, but I don't think this was ever a good idea and people should be using pytest's xfail or equivalent for it really (maybe we should too)
from hypothesis.
Ah, right. I agree that it's a separate concern to the rest of the Hypothesis API, and users should look to their test runner of choice. Probably still useful for us to have a runner-agnostic fails_with though.
from hypothesis.
Yup. It's perfectly sensible to have extra decorators like this internally and/or in the test helpers, just not part of the public API. Past-@DRMacIver had some odd ideas about API design which I've had to unlearn the hard way. :-)
from hypothesis.
people should be using pytest's xfail or equivalent for it really (maybe we should too)
For posterity: @pytest.mark.xfail(raises=FooError)
is semantically different to @fails_with(FooError)
- the former indicates that raising FooError is expected behaviour due to an unfixed bug (and the test is reported as xfailed rather than passed), while the latter indicates that the test should raise FooError to pass.
Our internal decorator is instead more like a decorator form of with pytest.raises(FooError): ...
.
from hypothesis.
Related Issues (20)
- Follow up on IR shrinking tasks
- `st.from_regex()` alphabet improvements
- Busy loop randomly runs 6x slower causing flaky DeadlineExceeded errors HOT 5
- Issues with django.forms.ModelChoiceField and ModelMultipleChoiceField HOT 1
- example generation regression between `6.47.0` -> `6.103.1` HOT 4
- `hypothesis.extra.pandas`: generate timezone-aware datetime columns
- Warning from tracer causes Flaky HOT 1
- Interest in a phone number strategy? HOT 1
- Improve testing story for Python 3.14 and free-threading builds
- `hypothesis codemod` doesn't update `Healthcheck.all()`
- Handle Django upgrades like Python versions in `./build.sh upgrade-requirements`
- Failing test for Django 5.0 HOT 1
- Using `builds` arguments for reprs may produce worse results than pretty printing HOT 2
- Improve error message when a package only has submodules for ghostwriter HOT 3
- Improve support for new and user-defined Numpy dtypes (e.g. `np.dtypes.StringDType`)
- Change Flaky to be an ExceptionGroup
- Error while patching time.perf_counter HOT 4
- Thread safety when usage with Pytest, and Coverage cause unexpected hang at exit HOT 3
- Falsifying examples not being printed HOT 8
- System.AccessViolationException with Hypothesis 6.108.x HOT 3
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 hypothesis.