Exemple #1
0
    def test_not_raise_exception_with_mixed_encoding(self, tw_mock) -> None:
        args = [("unicode_string", "São Paulo"),
                ("utf8_string", b"S\xc3\xa3o Paulo")]

        r = ReprFuncArgs(args)
        r.toterminal(tw_mock)

        assert (
            tw_mock.lines[0] ==
            r"unicode_string = São Paulo, utf8_string = b'S\xc3\xa3o Paulo'")
Exemple #2
0
    def test_not_raise_exception_with_mixed_encoding(self):
        from _pytest._code.code import ReprFuncArgs

        tw = TWMock()

        args = [("unicode_string", u"São Paulo"), ("utf8_string", "S\xc3\xa3o Paulo")]

        r = ReprFuncArgs(args)
        r.toterminal(tw)
        if sys.version_info[0] >= 3:
            assert tw.lines[0] == "unicode_string = São Paulo, utf8_string = São Paulo"
        else:
            assert tw.lines[0] == "unicode_string = São Paulo, utf8_string = São Paulo"
Exemple #3
0
    def test_not_raise_exception_with_mixed_encoding(self):
        from _pytest._code.code import ReprFuncArgs

        tw = TWMock()

        args = [("unicode_string", u"São Paulo"), ("utf8_string", b"S\xc3\xa3o Paulo")]

        r = ReprFuncArgs(args)
        r.toterminal(tw)

        assert (
            tw.lines[0]
            == r"unicode_string = São Paulo, utf8_string = b'S\xc3\xa3o Paulo'"
        )
Exemple #4
0
    def test_not_raise_exception_with_mixed_encoding(self):
        from _pytest._code.code import ReprFuncArgs

        tw = TWMock()

        args = [("unicode_string", u"São Paulo"),
                ("utf8_string", "S\xc3\xa3o Paulo")]

        r = ReprFuncArgs(args)
        r.toterminal(tw)
        if sys.version_info[0] >= 3:
            assert tw.lines[
                0] == "unicode_string = São Paulo, utf8_string = São Paulo"
        else:
            assert tw.lines[
                0] == "unicode_string = São Paulo, utf8_string = São Paulo"