We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If the 'persistent' argument is used in a request, StubTreq will throw exception "an unexpected keyword argument 'persistent'".
hieu@hieu-VirtualBox:~/workspace/treq$ python3 -m twisted.trial subtreq_issue.TestClientWrapper subtreq_issue TestClientWrapper test_get ... [ERROR] =============================================================================== [ERROR] Traceback (most recent call last): File "/home/hieu/workspace/treq/subtreq_issue.py", line 40, in test_get stub_content = yield ClientWrapper(stub_treq).get(url, persistent=False) File "/home/hieu/.local/lib/python3.8/site-packages/twisted/internet/defer.py", line 1697, in _inlineCallbacks result = context.run(gen.send, result) File "/home/hieu/workspace/treq/subtreq_issue.py", line 15, in get resp = yield self.client.get(url, persistent=persistent) File "/home/hieu/.local/lib/python3.8/site-packages/treq/testing.py", line 219, in wrapper return f(*args, **kwargs) File "/home/hieu/.local/lib/python3.8/site-packages/treq/client.py", line 161, in get return self.request('GET', url, **kwargs) builtins.TypeError: request() got an unexpected keyword argument 'persistent' subtreq_issue.TestClientWrapper.test_get ------------------------------------------------------------------------------- Ran 1 tests in 0.010s FAILED (errors=1)
It's ok if we use treq rather than StubTreq. In the source code of treq, it will pop that argument out before passing argument to the "request" function: https://github.com/twisted/treq/blob/release-22.2.0/src/treq/api.py#L220
def _client(kwargs): agent = kwargs.pop("agent", None) pool = kwargs.pop("pool", None) persistent = kwargs.pop("persistent", None)
However, SubTreq didn't pop that argument so it led to this problem
subtreq_issue.zip
The text was updated successfully, but these errors were encountered:
Thanks for the bug report.
Sorry, something went wrong.
No branches or pull requests
If the 'persistent' argument is used in a request, StubTreq will throw exception "an unexpected keyword argument 'persistent'".
It's ok if we use treq rather than StubTreq. In the source code of treq, it will pop that argument out before passing argument to the "request" function:
https://github.com/twisted/treq/blob/release-22.2.0/src/treq/api.py#L220
However, SubTreq didn't pop that argument so it led to this problem
subtreq_issue.zip
The text was updated successfully, but these errors were encountered: