Closed abidahmadq closed 2 years ago
@vytas7 please take a look.
Merging #1928 (cc92edb) into master (ddb4a03) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #1928 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 63 63
Lines 6676 6677 +1
Branches 1239 1239
=========================================
+ Hits 6676 6677 +1
Impacted Files | Coverage Δ | |
---|---|---|
falcon/response.py | 100.00% <100.00%> (ø) |
|
falcon/util/deprecation.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update ddb4a03...cc92edb. Read the comment docs.
@vytas7 what should i do about the deprecation warning?
`class LinkHeaderResource:
def init(self):
self._links = []
def append_link(self, *args, **kwargs):
self._links.append((args, kwargs))
def on_get(self, req, resp):
resp.text = '{}'
append_link = None
for args, kwargs in self._links:
append_link = (
resp.append_link if append_link is resp.add_link else resp.add_link
)
append_link(*args, **kwargs) --> line which is emiting the error.
`
How should i fix it?
1) remove the resp.add_link from the above line so it doesn't use the Alias.
2) Use @pytest.mark.filterwarnings to ignore the warnings.
3) Use with pytest.warns(UserWarning):
to catch it.
I think you can use the same pattern as here: https://github.com/falconry/falcon/blob/fb0d68688b29ae518f98798c278a5815e40660ca/tests/test_response_media.py#L182-L189
Hi again @abidahmadq , just checking if you had a chance to work on the second batch of my comments?
@vytas7 finding it confusing on how to proceed with this. Will take a look again on this weekend.
Thanks @vytas7
Summary of Changes
Added deprecation warning to the add_link() method.
Related Issues
Related to issue https://github.com/falconry/falcon/issues/1803
Pull Request Checklist
docs/
.docs/
.versionadded
,versionchanged
, ordeprecated
directives.docs/_newsfragments/
, with the file name format{issue_number}.{fragment_type}.rst
. (Runtowncrier --draft
to ensure it renders correctly.)