public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-misc/liquidctl/, app-misc/liquidctl/files/
@ 2024-06-06 12:52 Rick Farina
  0 siblings, 0 replies; only message in thread
From: Rick Farina @ 2024-06-06 12:52 UTC (permalink / raw
  To: gentoo-commits

commit:     f47fa22bdc6b6fe8e134cd72f26654038d1ad4dd
Author:     Rick Farina <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  6 12:51:58 2024 +0000
Commit:     Rick Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Thu Jun  6 12:52:42 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f47fa22b

app-misc/liquidctl: fix some test failures

Signed-off-by: Rick Farina <zerochaos <AT> gentoo.org>

 app-misc/liquidctl/files/709.patch         | 32 ++++++++++++++++++++++++++++++
 app-misc/liquidctl/liquidctl-1.13.0.ebuild |  3 +++
 2 files changed, 35 insertions(+)

diff --git a/app-misc/liquidctl/files/709.patch b/app-misc/liquidctl/files/709.patch
new file mode 100644
index 000000000000..dd0d6420a9da
--- /dev/null
+++ b/app-misc/liquidctl/files/709.patch
@@ -0,0 +1,32 @@
+From 470b159fddbf595ccbf6995b4f9e6a1462e97c65 Mon Sep 17 00:00:00 2001
+From: Jonas Malaco <jonas@protocubo.io>
+Date: Tue, 21 May 2024 15:53:40 -0300
+Subject: [PATCH] test_cli: don't change the type of sys.argv when
+ monkeypatching it
+
+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
+---
+ tests/test_cli.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_cli.py b/tests/test_cli.py
+index aa577ffc0..76791e896 100644
+--- a/tests/test_cli.py
++++ b/tests/test_cli.py
+@@ -11,7 +11,7 @@
+ def main(monkeypatch, capsys):
+     """Return a function f(*args) to run main with `args` as `sys.argv`."""
+     def call_with_args(*args):
+-        monkeypatch.setattr(sys, 'argv', args)
++        monkeypatch.setattr(sys, 'argv', list(args))
+         try:
+             liquidctl.cli.main()
+         except SystemExit as exit:

diff --git a/app-misc/liquidctl/liquidctl-1.13.0.ebuild b/app-misc/liquidctl/liquidctl-1.13.0.ebuild
index a2eb2e0132a7..6cec41aae631 100644
--- a/app-misc/liquidctl/liquidctl-1.13.0.ebuild
+++ b/app-misc/liquidctl/liquidctl-1.13.0.ebuild
@@ -28,6 +28,9 @@ BDEPEND="
 	dev-python/setuptools-scm[${PYTHON_USEDEP}]
 "
 
+# This is a merged PR, remove it on bump
+PATCHES=( "${FILESDIR}/709.patch" )
+
 distutils_enable_tests pytest
 
 src_test() {


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-06-06 12:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-06 12:52 [gentoo-commits] repo/gentoo:master commit in: app-misc/liquidctl/, app-misc/liquidctl/files/ Rick Farina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox