-
-
Notifications
You must be signed in to change notification settings - Fork 948
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
feat(testing): add msgpack support #2394
base: master
Are you sure you want to change the base?
Changes from 5 commits
9e9e3cd
8deb751
97a5a2a
58e251d
2cea4f6
f911793
aa6edf2
37d702e
4db15eb
918ba30
ef7a39d
f226b5b
f562383
41965f6
eab724a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need more extensive tests for this new feature. I would suggest to use We also want to test the combination of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a doubt about that, with json we pass parameters (json), (json, headers), (json,content-type), (json, headers, content-type), I did similar tests with both msgpack and json with msgpack, but mintests still breaks. What's the best way to parametrize it? And how do I check if simulated body is correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can parametrize a parameter by specifying different values that it is called with. As to checking whether a simulated body is correct, you can capture it in your test application that you are simulating requests against, and return it in the response. Or, you can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello @vytas7, I have two doubts:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We also need to add/adapt tests checking what happens when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How would I do that? Would it be with a try, except statement while importing msgpack? Or is there a better way for testing it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please check other existing tests, e.g., You can reuse the following pattern: # Somewhere in the beginning of the file, towards the end of the import blocks:
try:
import msgpack
except ImportError:
msgpack = None Then, later, shield your tests in question with the @pytest.mark.skipif(msgpack is None, reason='msgpack is required for this test')
def test_my_new_msgpack_parameter(some_param, ...):
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newsfragment file missing. You don't need to manually include it in
4.1.0.rst
, but rather create a separate newsfragment file. Please check our docs how to contribute these files.