public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Benjamin A. Beasley <code@musicinmybrain.net>
To: git-commits@fedoraproject.org
Subject: [rpms/scancode-toolkit] rawhide: Fix test failure with click 8.4
Date: Fri, 24 Jul 2026 20:02:40 GMT	[thread overview]
Message-ID: <178492336071.1.3916554241623430405.rpms-scancode-toolkit-8b9c6044e597@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/scancode-toolkit
            Branch : rawhide
            Commit : 8b9c6044e59788ccde62c74590e4f0499092d052
            Author : Benjamin A. Beasley <code@musicinmybrain.net>
            Date   : 2026-07-24T15:01:06-05:00
            Stats  : +44/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/scancode-toolkit/c/8b9c6044e59788ccde62c74590e4f0499092d052?branch=rawhide

            Log:
            Fix test failure with click 8.4

Make 'no such option' assertion tolerant of newer click error format

Closes: https://src.fedoraproject.org/rpms/scancode-toolkit/pull-request/8

---
diff --git a/a1c6435375866ae2fead2df2c967f2ba150f18e9.patch b/a1c6435375866ae2fead2df2c967f2ba150f18e9.patch
new file mode 100644
index 0000000..82a7906
--- /dev/null
+++ b/a1c6435375866ae2fead2df2c967f2ba150f18e9.patch
@@ -0,0 +1,41 @@
+From a1c6435375866ae2fead2df2c967f2ba150f18e9 Mon Sep 17 00:00:00 2001
+From: Guillem Serra Cazorla <guillem@meta.com>
+Date: Mon, 18 May 2026 14:19:39 +0100
+Subject: [PATCH] Make 'no such option' assertion tolerant of newer click error
+ format
+
+click >= 8.2 changed the unknown-option error message from
+  'Error: No such option: --foo'
+to
+  'Error: No such option '--foo'. (Did you mean ...)'
+
+This broke tests/scancode/test_cli.py::test_scan_errors_out_with_unknown_option
+on the *_latest_from_pip CI matrix (ubuntu22/24, macos14, win2019/2022).
+
+Relax the assertion to check for the stable substrings ('no such option'
+and the offending option name) instead of the exact phrasing, so the
+test works with both click < 8.2 and click >= 8.2.
+
+Signed-off-by: Guillem Serra Cazorla <guillem@meta.com>
+---
+ tests/scancode/test_cli.py | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py
+index 858baf68ca..9d038f71e6 100644
+--- a/tests/scancode/test_cli.py
++++ b/tests/scancode/test_cli.py
+@@ -730,7 +730,12 @@ def test_scan_errors_out_with_unknown_option():
+     test_file = test_env.get_test_loc('license_text/test.txt')
+     args = ['--json--info', test_file]
+     result = run_scan_click(args, expected_rc=2)
+-    assert 'Error: No such option: --json--info'.lower() in result.output.lower()
++    # Accept both the old and new click error message formats:
++    #   click < 8.2:  "Error: No such option: --json--info"
++    #   click >= 8.2: "Error: No such option '--json--info'. (Did you mean ...)"
++    output = result.output.lower()
++    assert 'no such option' in output
++    assert '--json--info' in output
+ 
+ 
+ def test_scan_to_json_without_FILE_does_not_write_to_next_option():

diff --git a/scancode-toolkit.spec b/scancode-toolkit.spec
index 156f393..740f4b4 100644
--- a/scancode-toolkit.spec
+++ b/scancode-toolkit.spec
@@ -21,6 +21,9 @@ Patch:          0001-tests-fix-pytest-traceback.patch
 # See note in https://github.com/aboutcode-org/scancode-toolkit/issues/4541
 # about why pkginfo2 was removed.
 Patch:          0002-Replace-pkginfo2-with-pkginfo.patch
+# Make 'no such option' assertion tolerant of newer click error format
+# https://github.com/aboutcode-org/scancode-toolkit/commit/a1c6435375866ae2fead2df2c967f2ba150f18e9
+Patch:          https://github.com/aboutcode-org/scancode-toolkit/commit/a1c6435375866ae2fead2df2c967f2ba150f18e9.patch
 
 # scancode has dependencies that are not compatible with ix86
 ExcludeArch:    %{ix86}

                 reply	other threads:[~2026-07-24 20:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178492336071.1.3916554241623430405.rpms-scancode-toolkit-8b9c6044e597@fedoraproject.org \
    --to=code@musicinmybrain.net \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox