Esempio 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", "?    +++"]
Esempio 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'",
    ]
Esempio 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'",
    ]
Esempio 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'",
    ]
Esempio n. 5
0
def callequal(left, right):
    return plugin.pytest_assertrepr_compare('==', left, right)
Esempio n. 6
0
def test_reprcompare_notin():
    detail = plugin.pytest_assertrepr_compare('not in', 'foo', 'aaafoobbb')[1:]
    assert detail == ["'foo' is contained here:", '  aaafoobbb', '?    +++']
Esempio 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', '?    +++']
Esempio n. 8
0
def callequal(left, right, verbose=False):
    config = mock_config()
    config.verbose = verbose
    return plugin.pytest_assertrepr_compare(config, '==', left, right)
Esempio n. 9
0
def callequal(left, right, verbose=0):
    config = mock_config(verbose=verbose)
    return plugin.pytest_assertrepr_compare(config, "==", left, right)
Esempio n. 10
0
def callequal(left, right, verbose=False):
    config = mock_config()
    config.verbose = verbose
    return plugin.pytest_assertrepr_compare(config, '==', left, right)
Esempio 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)
Esempio n. 12
0
def callequal(left, right):
    return plugin.pytest_assertrepr_compare('==', left, right)
Esempio n. 13
0
def test_reprcompare_notin():
    detail = plugin.pytest_assertrepr_compare("not in", "foo", "aaafoobbb")[1:]
    assert detail == ["'foo' is contained here:", "  aaafoobbb", "?    +++"]