diff --git a/pyproject.toml b/pyproject.toml index 780b5ab..241d62c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tools.black] -line-length=120 +line-length = 120 [tool.isort] profile = "black" @@ -8,8 +8,8 @@ multi_line_output = 3 [tool.pytest.ini_options] filterwarnings = [ - "error", - "ignore::pytest.PytestCollectionWarning", - "ignore:::pynvim[.*]" + "error", + "ignore::pytest.PytestCollectionWarning", + "ignore:::pynvim[.*]", ] - +asyncio_mode = "auto" diff --git a/rplugin/python3/ultest/handler/parsers/output.py b/rplugin/python3/ultest/handler/parsers/output.py index 59f57da..61978dc 100644 --- a/rplugin/python3/ultest/handler/parsers/output.py +++ b/rplugin/python3/ultest/handler/parsers/output.py @@ -40,6 +40,10 @@ class OutputPatterns: namespace_separator=" › ", ), "elixir#exunit": OutputPatterns(failed_test=r"\s*\d\) test (?P.*) \(.*\)$"), + "php#phpunit": OutputPatterns( + failed_test=r"\s*\d\) (?P.*)::(?P.*)", + namespace_separator=r"\\", + ), } # https://stackoverflow.com/questions/14693701/how-can-i-remove-the-ansi-escape-sequences-from-a-string-in-python diff --git a/tests/mocks/test_outputs/phpunit b/tests/mocks/test_outputs/phpunit new file mode 100644 index 0000000..3b4bfb6 --- /dev/null +++ b/tests/mocks/test_outputs/phpunit @@ -0,0 +1,18 @@ + +PHPUnit 9.5.8 by Sebastian Bergmann and contributors. + +F. 2 / 2 (100%) + +Time: 00:03.103, Memory: 40.50 MB + +There was 1 failure: + +1) Tests\FakeTest::test_fake +Failed asserting that 0.0 matches expected 1.0. + +/Users/bwubs/Projects/foo/tests/FakeTest:18 + +FAILURES! +Tests: 2, Assertions: 2, Failures: 1. + +[Process exited 1] diff --git a/tests/unit/handler/parsers/test_output.py b/tests/unit/handler/parsers/test_output.py index 7fc568c..6120c89 100644 --- a/tests/unit/handler/parsers/test_output.py +++ b/tests/unit/handler/parsers/test_output.py @@ -73,3 +73,11 @@ def test_parse_richgo(self): ParseResult(name="TestAAAB", namespaces=[]), ], ) + + def test_parse_phpunit(self): + output = get_output("phpunit") + failed = list(self.parser.parse_failed("php#phpunit", output)) + self.assertEqual( + failed, + [ParseResult(name="test_fake", namespaces=['Tests', 'FakeTest'])], + )