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

test_cli: don't change the type of sys.argv when monkeypatching it #709

Merged
merged 1 commit into from
May 22, 2024

Conversation

jonasmalacofilho
Copy link
Member

When setting up for the CLI tests, we inadvertently change the type of sys.argv from list to tuple. That worked with OG docopt, but breaks docopt-ng. More importantly, the Python docs say sys.argv is a list.

So even though docopt was able to handle it being a tuple, and docopt-ng seems (from a cursory look at its source) to still handle it being a string, let's use the correct type.

Fixes: #708


Checklist:

New CLI flag?

  • Adjust the completion scripts in extra/completions/

New device?

  • Regenerate extra/linux/71-liquidctl.rules (instructions in the file header)
  • Add entry to the README's supported device list with applicable notes and git MRLV

New driver?

  • Document the protocol in docs/developer/protocol/

When setting up for the CLI tests, we inadvertently change the type of
sys.argv from list to tuple. That worked with OG docopt, but breaks
docopt-ng. More importantly, the Python docs say sys.argv is a _list_.

So even though docopt was able to handle it being a tuple, and docopt-ng
seems (from a cursory look at its source) to still handle it being a
string, let's use the correct type.

Fixes: #708
@ZeroChaos-
Copy link

Tested and confirmed to resolve #708

@jonasmalacofilho jonasmalacofilho merged commit d343c0d into main May 22, 2024
20 checks passed
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.

v1.13.0 tests fail with python 3.12 on Gentoo
2 participants