Giter Club home page Giter Club logo

Comments (7)

johanneskastl avatar johanneskastl commented on July 22, 2024 1

@johanneskastl Have you seen other packages have this issue?

Hi Tony, none of the few python packages in openSUSE that I maintain has similar errors.

If I am not mistaken this also happen for all of the python versions in use (3.9/3.10/3.11).

from libtmux.

johanneskastl avatar johanneskastl commented on July 22, 2024

And another one:

[  242s] =================================== FAILURES ===================================
[  242s] ___________________________ test_function_times_out ____________________________
[  242s] 
[  242s]     def test_function_times_out() -> None:
[  242s]         ini = time()
[  242s]     
[  242s]         def never_true() -> bool:
[  242s]             return False
[  242s]     
[  242s]         with pytest.raises(WaitTimeout):
[  242s]             retry_until(never_true, 1)
[  242s]     
[  242s]         end = time()
[  242s]     
[  242s] >       assert abs((end - ini) - 1.0) < 0.01
[  242s] E       assert 0.010947227478027344 < 0.01
[  242s] E        +  where 0.010947227478027344 = abs(((1679552325.5506115 - 1679552324.5396643) - 1.0))
[  242s] 
[  242s] tests/test_test.py:41: AssertionError
[  242s] =============================== warnings summary ===============================

from libtmux.

tony avatar tony commented on July 22, 2024

@johanneskastl Have you seen other packages have this issue?

I am not quite sure how to help - but interested in finding a solution.

from libtmux.

tony avatar tony commented on July 22, 2024

I will look into a longterm solution or fix

Short term:

One possibility is I can disable the test on openSUSE - is there a reliable marker to check for OpenSUSE machines?

Also, if OpenSUSE packages can support patches, @pytest.mark.skip above test_function_times_out should skip it.

from libtmux.

johanneskastl avatar johanneskastl commented on July 22, 2024

I will look into a longterm solution or fix

Thank you!

Short term:

One possibility is I can disable the test on openSUSE - is there a reliable marker to check for OpenSUSE machines?

Also, if OpenSUSE packages can support patches, @pytest.mark.skip above test_function_times_out should skip it.

Thanks for the offer, but there is no need for a short term solution, I already excluded the failing tests in the package build.

from libtmux.

johanneskastl avatar johanneskastl commented on July 22, 2024

I got another one today: test_new_window_with_environment[environment0]

[  116s] =================================== FAILURES ===================================
[  116s] ________________ test_new_window_with_environment[environment0] ________________
[  116s] 
[  116s] session = Session($1 libtmux_imz1fuo6), environment = {'ENV_VAR': 'window'}
[  116s] 
[  116s]     @pytest.mark.skipif(
[  116s]         has_lt_version("3.0"),
[  116s]         reason="needs -e flag for new-window which was introduced in 3.0",
[  116s]     )
[  116s]     @pytest.mark.parametrize(
[  116s]         "environment",
[  116s]         [
[  116s]             {"ENV_VAR": "window"},
[  116s]             {"ENV_VAR_1": "window_1", "ENV_VAR_2": "window_2"},
[  116s]         ],
[  116s]     )
[  116s]     def test_new_window_with_environment(
[  116s]         session: Session,
[  116s]         environment: t.Dict[str, str],
[  116s]     ) -> None:
[  116s]         env = shutil.which("env")
[  116s]         assert env is not None, "Cannot find usable `env` in PATH."
[  116s]     
[  116s]         window = session.new_window(
[  116s]             attach=True,
[  116s]             window_name="window_with_environment",
[  116s]             window_shell=f"{env} PS1='$ ' sh",
[  116s]             environment=environment,
[  116s]         )
[  116s]         pane = window.attached_pane
[  116s]         assert pane is not None
[  116s]         for k, v in environment.items():
[  116s]             pane.send_keys(f"echo ${k}")
[  116s] >           assert pane.capture_pane()[-2] == v
[  116s] E           IndexError: list index out of range
[  116s] 
[  116s] tests/legacy_api/test_session.py:291: IndexError

from libtmux.

matoro avatar matoro commented on July 22, 2024

Observed this test_capture_pane_start failure on Gentoo also.

================================================================= FAILURES ==================================================================
__________________________________________________________ test_capture_pane_start __________________________________________________________

session = Session($1 libtmux_9bmi4d2z)

    def test_capture_pane_start(session: Session) -> None:
        """Assert Pane.capture_pane() with ``start`` param."""
        env = shutil.which("env")
        assert env is not None, "Cannot find usable `env` in PATH."

        session.new_window(
            attach=True,
            window_name="capture_pane_start",
            window_shell=f"{env} PS1='$ ' sh",
        )
        pane = session.active_window.active_pane
        assert pane is not None
        pane_contents = "\n".join(pane.capture_pane())
        assert pane_contents == "$"
        pane.send_keys(r'printf "%s"', literal=True, suppress_history=False)
        pane_contents = "\n".join(pane.capture_pane())
        assert pane_contents == '$ printf "%s"\n$'
        pane.send_keys("clear -x", literal=True, suppress_history=False)
        pane_contents = "\n".join(pane.capture_pane())
>       assert pane_contents == "$"
E       assert '$ printf "%s"\n$ clear -x' == '$'
E
E         - $
E         + $ printf "%s"
E         + $ clear -x

env        = '/usr/bin/env'
pane       = Pane(%2 Window(@2 2:capture_pane_start, Session($1 libtmux_9bmi4d2z)))
pane_contents = '$ printf "%s"\n$ clear -x'
session    = Session($1 libtmux_9bmi4d2z)

tests/test_pane.py:104: AssertionError

from libtmux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.