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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.


self.namespace = self.NameSpace()
Expand Down
Loading