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

pypy/module/_io/test/test_interp_textio.py::test_tell

space = StdObjSpace

    @given(content=st_readline(characters=st.characters(blacklist_categories='C')))
>   def test_tell(space, content):

module\_io\test\test_interp_textio.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\virt_test\site-packages\hypothesis\core.py:563: in execute
    result = self.test_runner(data, run)
..\virt_test\site-packages\hypothesis\executors.py:56: in default_new_style_executor
    return function(data)
..\virt_test\site-packages\hypothesis\core.py:561: in run
    return test(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

space = StdObjSpace, content = (u'\n', [0, -1])

    @given(content=st_readline(characters=st.characters(blacklist_categories='C')))
    def test_tell(space, content):
        txt, limits = content
    
        restxt = translate_newlines(txt)
        resstr = restxt.encode('utf-8')
        for read_chars_before_seeking in range(len(restxt)):
            w_stream = W_BytesIO(space)
            w_stream.descr_init(space, space.newbytes(txt.encode('utf-8')))
    
            w_textio = W_TextIOWrapper(space)
            w_textio.descr_init(
                space, w_stream,
                encoding='utf-8'
            )
    
            w_res1 = w_textio.read_w(space, space.newint(read_chars_before_seeking))
            assert space.len_w(w_res1) <= read_chars_before_seeking
            w_tell = w_textio.tell_w(space)
            w_textio.seek_w(space, space.newint(0)) # seek to beginning
            w_textio.seek_w(space, w_tell) # then back to position
            w_res2 = w_textio.read_w(space)
            w_res = space.add(w_res1, w_res2)
            res = space.text_w(w_res)
>           assert res == resstr
E           assert '\n' == '\r\n'
E             - 
E             + \r

module\_io\test\test_interp_textio.py:170: AssertionError
---------- Hypothesis ----------
Falsifying example: test_tell(space=StdObjSpace, content=(u'\n', [0, -1]))
builder: own-win-x86-64 build #2232
test: pypy/module/_io/test/test_interp_textio/py/test_tell