back to SWE-Agent summary
SWE-Agent: parsel
Pytest Summary for test tests
status |
count |
failed |
15 |
total |
15 |
collected |
15 |
passed |
0 |
Failed pytests:
test_utils.py::test_shorten[-1-ValueError]
test_utils.py::test_shorten[-1-ValueError]
width = -1, expected =
@mark.parametrize(
"width,expected",
(
(-1, ValueError),
(0, ""),
(1, "."),
(2, ".."),
(3, "..."),
(4, "f..."),
(5, "fo..."),
(6, "foobar"),
(7, "foobar"),
),
)
def test_shorten(width: int, expected: Union[str, Type[Exception]]) -> None:
if isinstance(expected, str):
assert shorten("foobar", width) == expected
else:
> with raises(expected):
E Failed: DID NOT RAISE
tests/test_utils.py:26: Failed
test_utils.py::test_shorten[0-]
test_utils.py::test_shorten[0-]
width = 0, expected = ''
@mark.parametrize(
"width,expected",
(
(-1, ValueError),
(0, ""),
(1, "."),
(2, ".."),
(3, "..."),
(4, "f..."),
(5, "fo..."),
(6, "foobar"),
(7, "foobar"),
),
)
def test_shorten(width: int, expected: Union[str, Type[Exception]]) -> None:
if isinstance(expected, str):
> assert shorten("foobar", width) == expected
E AssertionError
tests/test_utils.py:24: AssertionError
test_utils.py::test_shorten[1-.]
test_utils.py::test_shorten[1-.]
width = 1, expected = '.'
@mark.parametrize(
"width,expected",
(
(-1, ValueError),
(0, ""),
(1, "."),
(2, ".."),
(3, "..."),
(4, "f..."),
(5, "fo..."),
(6, "foobar"),
(7, "foobar"),
),
)
def test_shorten(width: int, expected: Union[str, Type[Exception]]) -> None:
if isinstance(expected, str):
> assert shorten("foobar", width) == expected
E AssertionError
tests/test_utils.py:24: AssertionError
test_utils.py::test_shorten[2-..]
test_utils.py::test_shorten[2-..]
width = 2, expected = '..'
@mark.parametrize(
"width,expected",
(
(-1, ValueError),
(0, ""),
(1, "."),
(2, ".."),
(3, "..."),
(4, "f..."),
(5, "fo..."),
(6, "foobar"),
(7, "foobar"),
),
)
def test_shorten(width: int, expected: Union[str, Type[Exception]]) -> None:
if isinstance(expected, str):
> assert shorten("foobar", width) == expected
E AssertionError
tests/test_utils.py:24: AssertionError
test_utils.py::test_shorten[3-...]
test_utils.py::test_shorten[3-...]
width = 3, expected = '...'
@mark.parametrize(
"width,expected",
(
(-1, ValueError),
(0, ""),
(1, "."),
(2, ".."),
(3, "..."),
(4, "f..."),
(5, "fo..."),
(6, "foobar"),
(7, "foobar"),
),
)
def test_shorten(width: int, expected: Union[str, Type[Exception]]) -> None:
if isinstance(expected, str):
> assert shorten("foobar", width) == expected
E AssertionError
tests/test_utils.py:24: AssertionError
test_utils.py::test_shorten[4-f...]
test_utils.py::test_shorten[4-f...]
width = 4, expected = 'f...'
@mark.parametrize(
"width,expected",
(
(-1, ValueError),
(0, ""),
(1, "."),
(2, ".."),
(3, "..."),
(4, "f..."),
(5, "fo..."),
(6, "foobar"),
(7, "foobar"),
),
)
def test_shorten(width: int, expected: Union[str, Type[Exception]]) -> None:
if isinstance(expected, str):
> assert shorten("foobar", width) == expected
E AssertionError
tests/test_utils.py:24: AssertionError
test_utils.py::test_shorten[5-fo...]
test_utils.py::test_shorten[5-fo...]
width = 5, expected = 'fo...'
@mark.parametrize(
"width,expected",
(
(-1, ValueError),
(0, ""),
(1, "."),
(2, ".."),
(3, "..."),
(4, "f..."),
(5, "fo..."),
(6, "foobar"),
(7, "foobar"),
),
)
def test_shorten(width: int, expected: Union[str, Type[Exception]]) -> None:
if isinstance(expected, str):
> assert shorten("foobar", width) == expected
E AssertionError
tests/test_utils.py:24: AssertionError
test_utils.py::test_shorten[6-foobar]
test_utils.py::test_shorten[6-foobar]
width = 6, expected = 'foobar'
@mark.parametrize(
"width,expected",
(
(-1, ValueError),
(0, ""),
(1, "."),
(2, ".."),
(3, "..."),
(4, "f..."),
(5, "fo..."),
(6, "foobar"),
(7, "foobar"),
),
)
def test_shorten(width: int, expected: Union[str, Type[Exception]]) -> None:
if isinstance(expected, str):
> assert shorten("foobar", width) == expected
E AssertionError
tests/test_utils.py:24: AssertionError
test_utils.py::test_shorten[7-foobar]
test_utils.py::test_shorten[7-foobar]
width = 7, expected = 'foobar'
@mark.parametrize(
"width,expected",
(
(-1, ValueError),
(0, ""),
(1, "."),
(2, ".."),
(3, "..."),
(4, "f..."),
(5, "fo..."),
(6, "foobar"),
(7, "foobar"),
),
)
def test_shorten(width: int, expected: Union[str, Type[Exception]]) -> None:
if isinstance(expected, str):
> assert shorten("foobar", width) == expected
E AssertionError
tests/test_utils.py:24: AssertionError
test_utils.py::test_extract_regex[(?P\\w+)\\s*(?P\\d+)\\s*\\,?\\s*(?P\\d+)-October 25, 2019-True-expected0]
regex = '(?P\\w+)\\s*(?P\\d+)\\s*\\,?\\s*(?P\\d+)'
text = 'October 25, 2019', replace_entities = True
expected = ['October', '25', '2019']
@mark.parametrize(
"regex, text, replace_entities, expected",
(
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25, 2019",
True,
["October", "25", "2019"],
],
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25 2019",
True,
["October", "25", "2019"],
],
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25 2019",
True,
["October"],
],
[
r"\w+\s*\d+\s*\,?\s*\d+",
"October 25 2019",
True,
["October 25 2019"],
],
[
r"^.*$",
""sometext" & "moretext"",
True,
['"sometext" & "moretext"'],
],
[
r"^.*$",
""sometext" & "moretext"",
False,
[""sometext" & "moretext""],
],
),
)
def test_extract_regex(
regex: Union[str, Pattern[str]],
text: str,
replace_entities: bool,
expected: List[str],
) -> None:
> assert extract_regex(regex, text, replace_entities) == expected
E AssertionError
tests/test_utils.py:77: AssertionError
test_utils.py::test_extract_regex[(?P\\w+)\\s*(?P\\d+)\\s*\\,?\\s*(?P\\d+)-October 25 2019-True-expected1]
regex = '(?P\\w+)\\s*(?P\\d+)\\s*\\,?\\s*(?P\\d+)'
text = 'October 25 2019', replace_entities = True
expected = ['October', '25', '2019']
@mark.parametrize(
"regex, text, replace_entities, expected",
(
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25, 2019",
True,
["October", "25", "2019"],
],
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25 2019",
True,
["October", "25", "2019"],
],
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25 2019",
True,
["October"],
],
[
r"\w+\s*\d+\s*\,?\s*\d+",
"October 25 2019",
True,
["October 25 2019"],
],
[
r"^.*$",
""sometext" & "moretext"",
True,
['"sometext" & "moretext"'],
],
[
r"^.*$",
""sometext" & "moretext"",
False,
[""sometext" & "moretext""],
],
),
)
def test_extract_regex(
regex: Union[str, Pattern[str]],
text: str,
replace_entities: bool,
expected: List[str],
) -> None:
> assert extract_regex(regex, text, replace_entities) == expected
E AssertionError
tests/test_utils.py:77: AssertionError
test_utils.py::test_extract_regex[(?P\\w+)\\s*(?P\\d+)\\s*\\,?\\s*(?P\\d+)-October 25 2019-True-expected2]
regex = '(?P\\w+)\\s*(?P\\d+)\\s*\\,?\\s*(?P\\d+)'
text = 'October 25 2019', replace_entities = True, expected = ['October']
@mark.parametrize(
"regex, text, replace_entities, expected",
(
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25, 2019",
True,
["October", "25", "2019"],
],
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25 2019",
True,
["October", "25", "2019"],
],
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25 2019",
True,
["October"],
],
[
r"\w+\s*\d+\s*\,?\s*\d+",
"October 25 2019",
True,
["October 25 2019"],
],
[
r"^.*$",
""sometext" & "moretext"",
True,
['"sometext" & "moretext"'],
],
[
r"^.*$",
""sometext" & "moretext"",
False,
[""sometext" & "moretext""],
],
),
)
def test_extract_regex(
regex: Union[str, Pattern[str]],
text: str,
replace_entities: bool,
expected: List[str],
) -> None:
> assert extract_regex(regex, text, replace_entities) == expected
E AssertionError
tests/test_utils.py:77: AssertionError
test_utils.py::test_extract_regex[\\w+\\s*\\d+\\s*\\,?\\s*\\d+-October 25 2019-True-expected3]
regex = '\\w+\\s*\\d+\\s*\\,?\\s*\\d+', text = 'October 25 2019'
replace_entities = True, expected = ['October 25 2019']
@mark.parametrize(
"regex, text, replace_entities, expected",
(
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25, 2019",
True,
["October", "25", "2019"],
],
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25 2019",
True,
["October", "25", "2019"],
],
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25 2019",
True,
["October"],
],
[
r"\w+\s*\d+\s*\,?\s*\d+",
"October 25 2019",
True,
["October 25 2019"],
],
[
r"^.*$",
""sometext" & "moretext"",
True,
['"sometext" & "moretext"'],
],
[
r"^.*$",
""sometext" & "moretext"",
False,
[""sometext" & "moretext""],
],
),
)
def test_extract_regex(
regex: Union[str, Pattern[str]],
text: str,
replace_entities: bool,
expected: List[str],
) -> None:
> assert extract_regex(regex, text, replace_entities) == expected
E AssertionError
tests/test_utils.py:77: AssertionError
test_utils.py::test_extract_regex[^.*$-"sometext" & "moretext"-True-expected4]
regex = '^.*$', text = '"sometext" & "moretext"'
replace_entities = True, expected = ['"sometext" & "moretext"']
@mark.parametrize(
"regex, text, replace_entities, expected",
(
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25, 2019",
True,
["October", "25", "2019"],
],
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25 2019",
True,
["October", "25", "2019"],
],
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25 2019",
True,
["October"],
],
[
r"\w+\s*\d+\s*\,?\s*\d+",
"October 25 2019",
True,
["October 25 2019"],
],
[
r"^.*$",
""sometext" & "moretext"",
True,
['"sometext" & "moretext"'],
],
[
r"^.*$",
""sometext" & "moretext"",
False,
[""sometext" & "moretext""],
],
),
)
def test_extract_regex(
regex: Union[str, Pattern[str]],
text: str,
replace_entities: bool,
expected: List[str],
) -> None:
> assert extract_regex(regex, text, replace_entities) == expected
E AssertionError
tests/test_utils.py:77: AssertionError
test_utils.py::test_extract_regex[^.*$-"sometext" & "moretext"-False-expected5]
regex = '^.*$', text = '"sometext" & "moretext"'
replace_entities = False
expected = ['"sometext" & "moretext"']
@mark.parametrize(
"regex, text, replace_entities, expected",
(
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25, 2019",
True,
["October", "25", "2019"],
],
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25 2019",
True,
["October", "25", "2019"],
],
[
r"(?P\w+)\s*(?P\d+)\s*\,?\s*(?P\d+)",
"October 25 2019",
True,
["October"],
],
[
r"\w+\s*\d+\s*\,?\s*\d+",
"October 25 2019",
True,
["October 25 2019"],
],
[
r"^.*$",
""sometext" & "moretext"",
True,
['"sometext" & "moretext"'],
],
[
r"^.*$",
""sometext" & "moretext"",
False,
[""sometext" & "moretext""],
],
),
)
def test_extract_regex(
regex: Union[str, Pattern[str]],
text: str,
replace_entities: bool,
expected: List[str],
) -> None:
> assert extract_regex(regex, text, replace_entities) == expected
E AssertionError
tests/test_utils.py:77: AssertionError
Patch diff