randy3k / radian

A 21 century R console
MIT License
2k stars 76 forks source link

test failures #355

Closed Alessandro-Barbieri closed 2 years ago

Alessandro-Barbieri commented 2 years ago

Gentoo CI had test failures

>>> Test phase: sci-mathematics/radian-0.6.0
 * python3_8: running distutils-r1_run_phase python_test
python3.8 -m pytest -vv -ra -l -Wdefault --color=no -p no:cov -p no:flake8 -p no:flakes -p no:pylint
============================= test session starts ==============================
platform linux -- Python 3.8.13, pytest-7.1.1, pluggy-1.0.0 -- /usr/bin/python3.8
cachedir: .pytest_cache
rootdir: /var/tmp/portage/sci-mathematics/radian-0.6.0/work/radian-0.6.0, configfile: setup.cfg, testpaths: tests
collecting ... collected 11 items

tests/test_aaa.py::test_aaa PASSED                                       [  9%]
tests/test_readline.py::test_readline PASSED                             [ 18%]
tests/test_reticulate.py::test_reticulate FAILED                         [ 27%]
tests/test_reticulate.py::test_multiline FAILED                          [ 36%]
tests/test_reticulate.py::test_ctrl_d FAILED                             [ 45%]
tests/test_reticulate.py::test_completion FAILED                         [ 54%]
tests/test_shell.py::test_shell PASSED                                   [ 63%]
tests/test_shell.py::test_cd PASSED                                      [ 72%]
tests/test_shell.py::test_cd2 PASSED                                     [ 81%]
tests/test_startup.py::test_startup PASSED                               [ 90%]
tests/test_version.py::test_version PASSED                               [100%]

=================================== FAILURES ===================================
_______________________________ test_reticulate ________________________________

terminal = <tests.terminal.Terminal object at 0x7f2488305550>

    def test_reticulate(terminal):
        terminal.current_line().assert_startswith("r$>")
        terminal.write("~")
>       terminal.previous_line(4).assert_startswith("Python", timeout=60)

terminal   = <tests.terminal.Terminal object at 0x7f2488305550>

tests/test_reticulate.py:12: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/terminal.py:91: in assert_startswith
    self._assert(str.startswith, operand, timeout)
        operand    = 'Python'
        self       = <tests.terminal.Var object at 0x7f24883058b0>
        timeout    = 60
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.terminal.Var object at 0x7f24883058b0>
op = <method 'startswith' of 'str' objects>, operand = 'Python', timeout = 60

    def _assert(self, op, operand, timeout=5):
        t = time.time()
        while time.time() - t < timeout:
            value = self.getter()
            if op(value, operand):
                break
            time.sleep(0.05)
        else:
>           raise Exception("value is {}".format(value))
E           Exception: value is

op         = <method 'startswith' of 'str' objects>
operand    = 'Python'
self       = <tests.terminal.Var object at 0x7f24883058b0>
t          = 1650279505.9275677
timeout    = 60
value      = '                                                                                                                        '

tests/terminal.py:88: Exception
________________________________ test_multiline ________________________________

terminal = <tests.terminal.Terminal object at 0x7f2488b3f4f0>

    def test_multiline(terminal):
        terminal.current_line().assert_startswith("r$>")
        terminal.write("~")
>       terminal.current_line().strip().assert_equal(">>>")

terminal   = <tests.terminal.Terminal object at 0x7f2488b3f4f0>

tests/test_reticulate.py:30: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/terminal.py:97: in assert_equal
    self._assert(operator.eq, operand, timeout)
        operand    = '>>>'
        self       = <tests.terminal.Var object at 0x7f2488bb5fa0>
        timeout    = 5
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.terminal.Var object at 0x7f2488bb5fa0>
op = <built-in function eq>, operand = '>>>', timeout = 5

    def _assert(self, op, operand, timeout=5):
        t = time.time()
        while time.time() - t < timeout:
            value = self.getter()
            if op(value, operand):
                break
            time.sleep(0.05)
        else:
>           raise Exception("value is {}".format(value))
E           Exception: value is r$> ~

op         = <built-in function eq>
operand    = '>>>'
self       = <tests.terminal.Var object at 0x7f2488bb5fa0>
t          = 1650279567.1675143
timeout    = 5
value      = 'r$> ~'

tests/terminal.py:88: Exception
_________________________________ test_ctrl_d __________________________________

terminal = <tests.terminal.Terminal object at 0x7f24882b5c40>

    def test_ctrl_d(terminal):
        terminal.current_line().assert_startswith("r$>")
        terminal.write("~")
>       terminal.current_line().strip().assert_equal(">>>")

terminal   = <tests.terminal.Terminal object at 0x7f24882b5c40>

tests/test_reticulate.py:49: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/terminal.py:97: in assert_equal
    self._assert(operator.eq, operand, timeout)
        operand    = '>>>'
        self       = <tests.terminal.Var object at 0x7f248832ca60>
        timeout    = 5
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.terminal.Var object at 0x7f248832ca60>
op = <built-in function eq>, operand = '>>>', timeout = 5

    def _assert(self, op, operand, timeout=5):
        t = time.time()
        while time.time() - t < timeout:
            value = self.getter()
            if op(value, operand):
                break
            time.sleep(0.05)
        else:
>           raise Exception("value is {}".format(value))
E           Exception: value is r$> ~

op         = <built-in function eq>
operand    = '>>>'
self       = <tests.terminal.Var object at 0x7f248832ca60>
t          = 1650279573.1367612
timeout    = 5
value      = 'r$> ~'

tests/terminal.py:88: Exception
_______________________________ test_completion ________________________________

terminal = <tests.terminal.Terminal object at 0x7f2488272850>

    def test_completion(terminal):
        terminal.current_line().assert_startswith("r$>")
        terminal.write("~")
>       terminal.current_line().strip().assert_equal(">>>")

terminal   = <tests.terminal.Terminal object at 0x7f2488272850>

tests/test_reticulate.py:63: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/terminal.py:97: in assert_equal
    self._assert(operator.eq, operand, timeout)
        operand    = '>>>'
        self       = <tests.terminal.Var object at 0x7f2488b4d1c0>
        timeout    = 5
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.terminal.Var object at 0x7f2488b4d1c0>
op = <built-in function eq>, operand = '>>>', timeout = 5

    def _assert(self, op, operand, timeout=5):
        t = time.time()
        while time.time() - t < timeout:
            value = self.getter()
            if op(value, operand):
                break
            time.sleep(0.05)
        else:
>           raise Exception("value is {}".format(value))
E           Exception: value is r$> ~

op         = <built-in function eq>
operand    = '>>>'
self       = <tests.terminal.Var object at 0x7f2488b4d1c0>
t          = 1650279579.1069064
timeout    = 5
value      = 'r$> ~'

tests/terminal.py:88: Exception
=========================== short test summary info ============================
FAILED tests/test_reticulate.py::test_reticulate - Exception: value is
FAILED tests/test_reticulate.py::test_multiline - Exception: value is r$> ~
FAILED tests/test_reticulate.py::test_ctrl_d - Exception: value is r$> ~
FAILED tests/test_reticulate.py::test_completion - Exception: value is r$> ~
==================== 4 failed, 7 passed in 87.29s (0:01:27) ====================

see https://839309.bugs.gentoo.org/attachment.cgi?id=771659 and https://bugs.gentoo.org/839309

Alessandro-Barbieri commented 2 years ago

I see that reticulate is needed