-
-
Notifications
You must be signed in to change notification settings - Fork 947
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 all commits
9e9e3cd
8deb751
97a5a2a
58e251d
2cea4f6
f911793
aa6edf2
37d702e
4db15eb
918ba30
ef7a39d
f226b5b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,21 @@ on GitHub. | |
|
||
.. NOTE(vytas): No changes to the supported platforms (yet). | ||
|
||
|
||
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. A diff still remains in this file against |
||
.. towncrier release notes start | ||
|
||
|
||
Misc | ||
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 do not render out newsfragments yourself; a Falcon release manager does that when the time comes. |
||
---- | ||
|
||
- Running mypy on code that uses parts of ``falcon.testing`` naively | ||
would lead to errors like:: | ||
|
||
Name "falcon.testing.TestClient" is not defined | ||
|
||
This has been fixed by explicitly exporting the names that are | ||
imported in the ``falcon.testing`` namespace. (`#2387 <https://github.com/falconry/falcon/issues/2387>`__) | ||
|
||
|
||
Contributors to this Release | ||
---------------------------- | ||
|
||
|
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. 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.