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

bug introduced by commit c4276791713e47a76433122ddf7fdedb2a5a3d44 (pytest <=7.4.4) #677

Closed
mguijarr opened this issue Jun 6, 2024 · 5 comments · Fixed by #678
Closed

Comments

@mguijarr
Copy link

mguijarr commented Jun 6, 2024

I am really sorry to say, a subtle bug has been introduced by this commit, and I didn't see it while doing the review 😫

At the moment, modules is always [''] which prevents Redis to start...
I wonder how it could pass all tests ?

In anyways, the fix is super easy, in file pytest_redis/config.py instead of:

if (modules := get_conf_option("modules")) is not None:
                                             ^^^^^^^^^^
        modules = modules.split(",")
else:
        modules = []

The config key is empty string so it is enough to make the test as: if (modules := get_conf_option("modules")):

Again, I apologize for not having seen it before.

@mguijarr
Copy link
Author

mguijarr commented Jun 6, 2024

The fix that works for me is #678

@mguijarr
Copy link
Author

mguijarr commented Jun 6, 2024

Hmm... My bad 🤔 In fact there seem to be no problem 😅 Sorry... Something remains in my code that is passing modules or something like this !

@mguijarr mguijarr closed this as completed Jun 6, 2024
@fizyk
Copy link
Member

fizyk commented Jun 6, 2024

Could be an empty call to modules @mguijarr

@mguijarr mguijarr reopened this Jun 6, 2024
@mguijarr
Copy link
Author

mguijarr commented Jun 6, 2024

I identified the problem: the code in commit c427679 does not work with pytest <=7.4.4 ; the behaviour in pytest 8.0 is correct, this corresponds to this change:

pytest-dev/pytest#11282

More specifically the line that was causing problem in 7.4.4 is:

https://github.com/pytest-dev/pytest/blob/b73b4c464c6fa54f55a1c6ed8eaceb5529a161bb/src/_pytest/config/__init__.py#L1527

@mguijarr mguijarr changed the title bug introduced by commit c4276791713e47a76433122ddf7fdedb2a5a3d44 bug introduced by commit c4276791713e47a76433122ddf7fdedb2a5a3d44 (pytest <8.2) Jun 6, 2024
@mguijarr mguijarr changed the title bug introduced by commit c4276791713e47a76433122ddf7fdedb2a5a3d44 (pytest <8.2) bug introduced by commit c4276791713e47a76433122ddf7fdedb2a5a3d44 (pytest <=7.4.4) Jun 6, 2024
@mguijarr
Copy link
Author

mguijarr commented Jun 6, 2024

So, to keep compatibility with pytest <8 , I would recommend applying the proposed MR, if you want

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 a pull request may close this issue.

2 participants