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

Only call super() during MockHttp if required #2033

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

s-t-e-v-e-n-k
Copy link

@s-t-e-v-e-n-k s-t-e-v-e-n-k commented Sep 3, 2024

Only instantiate superclasses of MockHttp if we are provided keyword arguments

Description

With pytest 8.2 and above, any class that contains tests is collected, which means they are instantiated, which MockHttp's superclasses do not accept, since they require keyword arguments. To work around this, only call the superclass's init method if we are passed kwargs.

Status

Done, ready for review

Checklist (tick everything that applies)

  • Code linting (required, can be done after the PR checks)
  • Documentation (as code comments)
  • Tests
  • ICLA (required for bigger changes)

With pytest 8.2 and above, any class that contains classes is collected,
which means they are instantiated, which MockHttp's superclasses do not
accept, since they require keyword arguments. To work around this, only
call the superclass's __init__ method if we are passed kwargs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant