Exemplo n.º 1
0
def test_reprcompare_notin(mock_config):
    detail = plugin.pytest_assertrepr_compare(
        mock_config, "not in", "foo", "aaafoobbb"
    )[
        1:
    ]
    assert detail == ["'foo' is contained here:", "  aaafoobbb", "?    +++"]
Exemplo n.º 2
0
def test_reprcompare_whitespaces(mock_config):
    detail = plugin.pytest_assertrepr_compare(mock_config, '==', '\r\n', '\n')
    assert detail == [
        r"'\r\n' == '\n'",
        r"Strings contain only whitespace, escaping them using repr()",
        r"- '\r\n'",
        r"?  --",
        r"+ '\n'",
    ]
Exemplo n.º 3
0
def test_reprcompare_whitespaces():
    config = mock_config()
    detail = plugin.pytest_assertrepr_compare(config, "==", "\r\n", "\n")
    assert detail == [
        r"'\r\n' == '\n'",
        r"Strings contain only whitespace, escaping them using repr()",
        r"- '\r\n'",
        r"?  --",
        r"+ '\n'",
    ]
Exemplo n.º 4
0
def test_reprcompare_whitespaces():
    config = mock_config()
    detail = plugin.pytest_assertrepr_compare(config, "==", "\r\n", "\n")
    assert detail == [
        r"'\r\n' == '\n'",
        r"Strings contain only whitespace, escaping them using repr()",
        r"- '\r\n'",
        r"?  --",
        r"+ '\n'",
    ]
Exemplo n.º 5
0
def callequal(left, right):
    return plugin.pytest_assertrepr_compare('==', left, right)
Exemplo n.º 6
0
def test_reprcompare_notin():
    detail = plugin.pytest_assertrepr_compare('not in', 'foo', 'aaafoobbb')[1:]
    assert detail == ["'foo' is contained here:", '  aaafoobbb', '?    +++']
Exemplo n.º 7
0
def test_reprcompare_notin(mock_config):
    detail = plugin.pytest_assertrepr_compare(mock_config, 'not in', 'foo',
                                              'aaafoobbb')[1:]
    assert detail == ["'foo' is contained here:", '  aaafoobbb', '?    +++']
Exemplo n.º 8
0
def callequal(left, right, verbose=False):
    config = mock_config()
    config.verbose = verbose
    return plugin.pytest_assertrepr_compare(config, '==', left, right)
Exemplo n.º 9
0
def callequal(left, right, verbose=0):
    config = mock_config(verbose=verbose)
    return plugin.pytest_assertrepr_compare(config, "==", left, right)
Exemplo n.º 10
0
def callequal(left, right, verbose=False):
    config = mock_config()
    config.verbose = verbose
    return plugin.pytest_assertrepr_compare(config, '==', left, right)
Exemplo n.º 11
0
def callop(op: str,
           left: Any,
           right: Any,
           verbose: int = 0) -> Optional[List[str]]:
    config = mock_config(verbose=verbose)
    return plugin.pytest_assertrepr_compare(config, op, left, right)
Exemplo n.º 12
0
def callequal(left, right):
    return plugin.pytest_assertrepr_compare('==', left, right)
Exemplo n.º 13
0
def test_reprcompare_notin():
    detail = plugin.pytest_assertrepr_compare("not in", "foo", "aaafoobbb")[1:]
    assert detail == ["'foo' is contained here:", "  aaafoobbb", "?    +++"]