-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Description
I am having some issue asserting attributes from FastAPI Depends class. The Depends have an attribute for saving your dependency:
class Depends:
def __init__(dependency):
self.dependency = dependencyThe dependency attribute must be a callable (anything that implements __call__).
I am trying to replace this function in my test for something like:
assert_that(dependencies).extracting('dependency').is_equal_to([dependency_limiter])However, as the dependency attribute is a callable, because the zero-args-method-call feature, the extracting method is calling dependency attribute instead of just returning it.
I think the behavior I described above would be better. What do you think?
I am submitting a PR in case you agree with me.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels