Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Shouldn't call callable attributes with .extracting #124

Copy link
Copy link
@santunioni

Description

@santunioni
Issue body actions

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 = dependency

The 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.