-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Feature/new hooks #177
Feature/new hooks #177
Conversation
I'm trying to understand the use cases and how someone would use this? Can you add multiple before after hooks? From the code I can see you mention being able to do timing, and there's some stuff about logging. Are there other things which could be done too? Some docs would be helpful. I'd be happy to write them if you can expand on it a bit here. |
The use case is mainly to provide people with a way to implement their own ways of dealing with the test results. For example pytest-html lets you create a html report from pytest tests, but won't allow you to fully express the concept of the headers/response body/status code and dump it to a machine readable format. If we add something like a On top of that, there is some stuff in the tests like |
1.It would be good if we provide Unicode string object validator like !anyunicode or something related to that...As far I know from documentation there is no option available.Is there any feature like this implemented.I am using external function for validating this. |
fbece9f
to
c2225b4
Compare
ba8cc35
to
48d3bac
Compare
using pytest's built in hook functionality
[ci skip]
[ci skip]
[ci skip]
0aede3a
to
3afe928
Compare
Adding some basic hooks which could be expanded further down the line. After thinking about it, I think this is much better than having a fixture.
At the time of writing this is just a simple thing which prints a response (not fully implemented), some other obvious ones are:
They will all basically just be called with the test name, stage name, stage number, and then a dictionary of any extra relevant information (the schema of which is undefined).
This is not the same as #115, these hooks are always called