Test failures with click 8.2.0

Open Beginner friendly
#1,293 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
cli, testing-qa

Research direction

Start with tests/test_embed_cli.py, especially test_embed_multi_files_encoding and its CliRunner setup. Read the Click 8.2.0 changes linked in the issue, then run the failing test; done means the affected tests pass with Click 8.2.0.

Written by the indexing model from the issue text.

Description

While building for nixpkgs:

______________ test_embed_multi_files_encoding[extra_args0-None] _______________

multi_files = ('/nix/var/nix/builds/nix-build-python3.13-llm-0.27.1.drv-0/b/pytest-of-_nixbld13/pytest-0/test_embed_multi_files_enco...ix/builds/nix-build-python3.13-llm-0.27.1.drv-0/b/pytest-of-_nixbld13/pytest-0/test_embed_multi_files_encodin0/files'))
extra_args = [], expected_error = None

    @pytest.mark.parametrize(
        "extra_args,expected_error",
        (
            # With no args default utf-8 with latin-1 fallback should work
            ([], None),
            (["--encoding", "utf-8"], "Could not decode text in file"),
            (["--encoding", "latin-1"], None),
            (["--encoding", "latin-1", "--encoding", "utf-8"], None),
            (["--encoding", "utf-8", "--encoding", "latin-1"], None),
        ),
    )
    def test_embed_multi_files_encoding(multi_files, extra_args, expected_error):
        db_path, files = multi_files
>       runner = CliRunner(mix_stderr=False)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'

tests/test_embed_cli.py:585: TypeError
__ test_embed_multi_files_encoding[extra_args1-Could not decode text in file] __

multi_files = ('/nix/var/nix/builds/nix-build-python3.13-llm-0.27.1.drv-0/b/pytest-of-_nixbld13/pytest-0/test_embed_multi_files_enco...ix/builds/nix-build-python3.13-llm-0.27.1.drv-0/b/pytest-of-_nixbld13/pytest-0/test_embed_multi_files_encodin1/files'))
extra_args = ['--encoding', 'utf-8']
expected_error = 'Could not decode text in file'

See https://click.palletsprojects.com/en/stable/changes/#version-8-2-0

Dominant language
Python
Stars
12.5k
Forks
998
Avg merge
8d 1h
Merged PRs (30d)
12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from simonw/llm

All issues in simonw/llm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.