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

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

space = StdObjSpace

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

module\_io\test\test_interp_textio.py:173: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\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_getstate_setstate(space, content):
        txt, limits = content
    
        restxt = translate_newlines(txt)
        for read_chars_before_getstate 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_state_start = w_textio.w_decoder.getstate_w(space)
            w_res1 = w_textio.read_w(space, space.newint(read_chars_before_getstate))
            w_current_state = w_textio.w_decoder.getstate_w(space)
            w_textio.w_decoder.setstate_w(space, w_state_start)
            w_textio.w_decoder.setstate_w(space, w_current_state)
            w_res2 = w_textio.read_w(space)
            w_res = space.add(w_res1, w_res2)
            res = space.text_w(w_res).decode("utf-8")
>           assert res == restxt
E           assert u'\n' == u'\r\n'

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