-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
allow to disable the asserts #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt): that use-case does indeed sound rather strange before accepting we'd like to get a better understanding about the reasons you do things the way you do them your general description leaves me with a "something is not right/missing" feeling |
Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt): lt me recap my basic understanding of the problem in real tests you use system objects, stuff is finein quick tests you use mocks, asserts failis it correct that you want to skip over assertions if a certain mock object is used? |
Original comment by Anonymous: Thanks for your quick response. We develop a complex project not in python - but we use py.test and python def test_scenario(a_remote_object):
}}} As you can see our tests are just series of actions against a remote object. I guess the feature that we really asks is the ability customize the use of py.test AST rewrite code. with a nodes that does: {{{ And the options are endless. |
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42): Anonymous, the example you are giving does not directly contain asserts. Are they contained in the check_function? I am also reluctant to expose AssertionRewriter and i don't think you could implement this pdb behaviour easily or did you try that? Did you try to a route your checks through a function which could be instrumented via e.g. --cancel-asserts to ignore assertion errors? Maybe in the end a general --cancel-asserts like option might make some sense. Probably spelled --assert=remove. I am not convinced yet. |
Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt): seems like this is now a dead end and more constructuve discussion did not happen, closing |
Revert "dist: Remove support for building and distributing *.egg files"
Originally reported by: Anonymous
Hey - we use py.test as our product test platform - and we
find it very useful.
One feature though we uses and might be nice if will be shared with the word is disable asserts during test development.
When we write integration test and system test - that take long time to run - we asserts a lot of thing (the single assert per test methodology is nice but in practice it reduce the time take the tests to run) - and most of the time (again in development) we fail on asserts.
Moreover - we use mocks for speed the development process of this kind of tests (find name errors and other thing that we don't want to waste half a hour to discover) - but the mocks tend to fail on the first assert the meet.
Therefore we used your great frame work and write some plugin that monkey patch the assert rewrite module with the following class instead of AssertionRewriter class.
and patches PYC_EXT - to '.pycNoAsserts'.
That works nice and helped us a lot. but because of the entire monkey patching is kind of fragile (the code
might of rewrite module might change someday and we will never know) it would be nice if this option will be
supported naturally by py.test. (we know it sounds a strange feature to ask - the ability to disables asserts in test - but it works and allow us to reduce our development time)
The text was updated successfully, but these errors were encountered: