Home - Summaries: (main) : (py3.11) : (py3.12) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

test_textio:test_readline

@given(data=st_readline_universal(),
>          mode=st.sampled_from(['\r', '\n', '\r\n', '', None]))
    def test_readline(data, mode):

..\build\extra_tests\test_textio.py:31: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy-venv\site-packages\hypothesis\core.py:624: in execute_once
    result = self.test_runner(data, run)
pypy-venv\site-packages\hypothesis\executors.py:56: in default_new_style_executor
    return function(data)
pypy-venv\site-packages\hypothesis\core.py:620: in run
    return test(*args, **kwargs)
..\build\extra_tests\test_textio.py:31: in test_readline
    mode=st.sampled_from(['\r', '\n', '\r\n', '', None]))
pypy-venv\site-packages\hypothesis\core.py:544: in test
    result = self.test(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

data = ('
', [0, -1]), mode = None

    @given(data=st_readline_universal(),
           mode=st.sampled_from(['\r', '\n', '\r\n', '', None]))
    def test_readline(data, mode):
        txt, limits = data
        textio = TextIOWrapper(
            BytesIO(txt.encode('utf-8', 'surrogatepass')),
            encoding='utf-8', errors='surrogatepass', newline=mode)
        lines = []
        for limit in limits:
            line = textio.readline(limit)
            if limit >= 0:
                assert len(line) <= limit
            if line:
                lines.append(line)
            elif limit:
                break
        if mode is None:
            txt = translate_newlines(txt)
>       assert txt.startswith(u''.join(lines))
E       AssertionError: assert False
E        +  where False = <bound method unicode.startswith of u'\r\n'>('\n')
E        +    where <bound method unicode.startswith of u'\r\n'> = '
\n'.startswith
E        +    and   '\n' = <bound method unicode.join of u''>(['\n'])
E        +      where <bound method unicode.join of u''> = ''.join

..\build\extra_tests\test_textio.py:48: AssertionError
builder: pypy-c-jit-win-x86-64 build #2505+
test: test_textio:test_readline