Skip to content
New issue

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

Fix default_context_manager in conjunction with ExitStack. #344

Closed

Conversation

richardjrossiii
Copy link
Member

Summary:
As outlined in the comment; because our MethodProxy objects don't get bound to
the object (via get); when (Async)ExitStack comes along and invokes:

enter_fn = cm.__class_.__enter__
enter_fn(cm)

A problem occurs - while the attribute lookup succeeds (yay); it's not
expecting a self paramter explicitly passed here, as it's not a bound python
method.

Theoretically; magic could be added to MethodProxy to properly bind via
__get__, but my knowledge of testslide right now isn't strong enough to feel
confident in that approach, so I'm opting for this.

Differential Revision: D42114206

@facebook-github-bot facebook-github-bot added CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported labels Dec 17, 2022
@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D42114206

richardjrossiii pushed a commit to richardjrossiii/TestSlide that referenced this pull request Dec 17, 2022
)

Summary:
Pull Request resolved: facebook#344

As outlined in the comment; because our MethodProxy objects don't get bound to
the object (via __get__); when (Async)ExitStack comes along and invokes:

```
enter_fn = cm.__class_.__enter__
enter_fn(cm)
```

A problem occurs - while the attribute lookup succeeds (yay); it's not
expecting a `self` paramter explicitly passed here, as it's not a bound python
method.

Theoretically; magic could be added to MethodProxy to properly bind via
`__get__`, but my knowledge of testslide right now isn't strong enough to feel
confident in that approach, so I'm opting for this.

Differential Revision: D42114206

fbshipit-source-id: 20082f79e87ca7d7e8eca5f119f7fc8ca1c03d55
@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D42114206

@coveralls
Copy link

coveralls commented Dec 17, 2022

Pull Request Test Coverage Report for Build 3717736742

  • 12 of 12 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.754%

Totals Coverage Status
Change from base Build 3713484083: 0%
Covered Lines: 2627
Relevant Lines: 2802

💛 - Coveralls

richardjrossiii pushed a commit to richardjrossiii/TestSlide that referenced this pull request Dec 17, 2022
)

Summary:
Pull Request resolved: facebook#344

As outlined in the comment; because our MethodProxy objects don't get bound to
the object (via __get__); when (Async)ExitStack comes along and invokes:

```
enter_fn = cm.__class_.__enter__
enter_fn(cm)
```

A problem occurs - while the attribute lookup succeeds (yay); it's not
expecting a `self` paramter explicitly passed here, as it's not a bound python
method.

Theoretically; magic could be added to MethodProxy to properly bind via
`__get__`, but my knowledge of testslide right now isn't strong enough to feel
confident in that approach, so I'm opting for this.

Differential Revision: D42114206

fbshipit-source-id: 7d0ab06716654884e5585003c76b4e82cbad3e8e
@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D42114206

Summary:
As outlined in the comment; because our MethodProxy objects don't get bound to
the object (via __get__); when (Async)ExitStack comes along and invokes:

```
enter_fn = cm.__class_.__enter__
enter_fn(cm)
```

A problem occurs - while the attribute lookup succeeds (yay); it's not
expecting a `self` paramter explicitly passed here, as it's not a bound python
method.

Theoretically; magic could be added to MethodProxy to properly bind via
`__get__`, but my knowledge of testslide right now isn't strong enough to feel
confident in that approach, so I'm opting for this.

Differential Revision: D42114206

fbshipit-source-id: 65d3c17d4c8f8069033cb9cd7cd0734eda8d4d9f
@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D42114206

@facebook-github-bot
Copy link

This pull request has been merged in 4f9fe23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants