tmux-python / tmux-python/tmuxp

1.12.1: test_environment_variables fails

Open
#792 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
4.6k
Forks
248
Avg merge
2h 13m
Merged PRs (30d)
1

Description

Step 1: Provide a summary of your problem

When packaging 1.12.1 for Arch Linux, test_environment_variables failed.

Step 2: Provide tmuxp details

n/a

Step 3: Describe the problem:
Steps to reproduce:
  1. python -m build --wheel --no-isolation
  2. pytest -vv
Observed Results:
=================================== FAILURES ===================================
__________________________ test_environment_variables __________________________

session = Session($1 libtmux_sfy1ixon)

    def test_environment_variables(session):
        yaml_config = test_utils.read_config_file("workspacebuilder/environment_vars.yaml")
        sconfig = kaptan.Kaptan(handler="yaml")
        sconfig = sconfig.import_config(yaml_config).get()
        sconfig = config.expand(sconfig)

        builder = WorkspaceBuilder(sconf=sconfig)
        builder.build(session)

>       assert session.show_environment("FOO") == "BAR"
E       TypeError: EnvironmentMixin.show_environment() takes 1 positional argument but 2 were given

tests/test_workspacebuilder.py:348: TypeError
=============================== warnings summary ===============================
../../../../usr/lib/python3.10/site-packages/libtmux/common.py:574: 1 warning
tests/test_cli.py: 226 warnings
tests/test_plugin.py: 10 warnings
tests/test_util.py: 8 warnings
tests/test_workspacebuilder.py: 206 warnings
tests/test_workspacefreezer.py: 5 warnings
tests/tests/test_helpers.py: 12 warnings
  /usr/lib/python3.10/site-packages/libtmux/common.py:574: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    return LooseVersion(version)

../../../../usr/lib/python3.10/site-packages/libtmux/common.py:659
  /usr/lib/python3.10/site-packages/libtmux/common.py:659: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    return get_version() < LooseVersion(max_version)

tests/test_cli.py: 172 warnings
tests/test_util.py: 8 warnings
tests/test_workspacebuilder.py: 206 warnings
tests/test_workspacefreezer.py: 5 warnings
tests/tests/test_helpers.py: 12 warnings
  /usr/lib/python3.10/site-packages/libtmux/common.py:625: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    return get_version() >= LooseVersion(min_version)

tests/test_cli.py: 52 warnings
  /usr/lib/python3.10/site-packages/libtmux/common.py:692: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if get_version() < LooseVersion(TMUX_MIN_VERSION):

tests/test_cli.py: 1 warning
tests/test_plugin.py: 10 warnings
  /build/tmuxp/src/tmuxp-1.12.1/tmuxp/plugin.py:87: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    self.tmuxp_version = LooseVersion(__version__)

tests/test_cli.py: 3 warnings
tests/test_plugin.py: 48 warnings
  /build/tmuxp/src/tmuxp-1.12.1/tmuxp/plugin.py:138: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if vmin and version < LooseVersion(vmin):

tests/test_cli.py: 1 warning
tests/test_plugin.py: 34 warnings
  /usr/lib/python3.10/site-packages/setuptools/_distutils/version.py:351: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    other = LooseVersion(other)

tests/test_cli.py: 1 warning
tests/test_plugin.py: 11 warnings
  /build/tmuxp/src/tmuxp-1.12.1/tmuxp/plugin.py:140: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if vmax and version > LooseVersion(vmax):

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_workspacebuilder.py::test_environment_variables - TypeError...
==== 1 failed, 178 passed, 2 skipped, 1 deselected, 1033 warnings in 24.92s ====`

Full build log:
tmuxp-1.12.1-1-x86_64-build.log

Full test log:
tmuxp-1.12.1-1-x86_64-check.log

Expected Results:

Tests pass.

Relevant Code:

n/a

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.

Research direction

Run pytest and inspect tests/test_workspacebuilder.py around test_environment_variables, then review the libtmux EnvironmentMixin.show_environment signature named in the traceback. Confirm the compatibility issue and verify that pytest passes after the test and implementation agree on the environment-variable lookup.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.