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 compatibility with pytest 8 #1996

Merged
merged 1 commit into from
May 22, 2024

Conversation

frenzymadness
Copy link
Contributor

Fixes #1995

@davidhalter
Copy link
Owner

Thanks a lot!

@davidhalter davidhalter merged commit 39c8317 into davidhalter:master May 22, 2024
114 checks passed
@@ -12,7 +12,7 @@ class TestSetupReadline(unittest.TestCase):
class NameSpace(object):
pass

def __init__(self, *args, **kwargs):
def setUp(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the call to super() not also be changed to super().setUp(*args, **kwargs)?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh thanks Peter! Yes that would be a very welcome change. I suspect this is just an oversight...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rename proposed here was to make the pytest call the method automatically. I think it's fine to call init in the setUp method. I don't have a strong opinion.

Copy link
Owner

@davidhalter davidhalter May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added 065580b. I feel like it's both fine to call super there or call nothing at all. But it feels very wrong to call __init__ from setUp. I'm pretty sure that was called before setUp.

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.

Issues with pytest 8
4 participants