You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if you specify a files= argument to StubTreq, it complains that this is not supported.
The reason it's not supported is that HTTPClient.request, when given a files= argument, will construct a treq.multipart.MultiPartProducer without giving it a cooperator= argument; the default value for cooperator= is twisted.internet.task, which populates MultiPartProducer._cooperate with twisted.internet.task.cooperate, which implicitly references the global reactor.
It should be possible to push down a Cooperator object through HTTPClient so that the instantiated MultiPartProducer can use the passed in one. (Given that Cooperator is itself a stateful scheduler, it's not quite enough just to pass an IReactorTime.)
The text was updated successfully, but these errors were encountered:
Currently if you specify a
files=
argument toStubTreq
, it complains that this is not supported.The reason it's not supported is that
HTTPClient.request
, when given afiles=
argument, will construct atreq.multipart.MultiPartProducer
without giving it acooperator=
argument; the default value forcooperator=
istwisted.internet.task
, which populatesMultiPartProducer._cooperate
withtwisted.internet.task.cooperate
, which implicitly references the global reactor.It should be possible to push down a
Cooperator
object throughHTTPClient
so that the instantiatedMultiPartProducer
can use the passed in one. (Given thatCooperator
is itself a stateful scheduler, it's not quite enough just to pass anIReactorTime
.)The text was updated successfully, but these errors were encountered: