diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 830d4e3..bb92c8d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: args: ['--application-directories=.:src'] name: reorder python imports - repo: https://github.com/psf/black-pre-commit-mirror - rev: 25.12.0 + rev: 26.1.0 hooks: - id: black args: [--safe, --quiet] diff --git a/setup.py b/setup.py index 657537c..c79698f 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ from setuptools import setup - setup( name="pytest-cpp", use_scm_version=True, diff --git a/src/pytest_cpp/catch2.py b/src/pytest_cpp/catch2.py index 2c237a2..8b4eb9e 100644 --- a/src/pytest_cpp/catch2.py +++ b/src/pytest_cpp/catch2.py @@ -15,7 +15,6 @@ from pytest_cpp.facade_abc import AbstractFacade from pytest_cpp.helpers import make_cmdline - # Map each special character's Unicode ordinal to the escaped character. _special_chars_map: dict[int, str] = {i: "\\" + chr(i) for i in b'[]*,~\\"'} diff --git a/src/pytest_cpp/plugin.py b/src/pytest_cpp/plugin.py index 138c654..781b738 100644 --- a/src/pytest_cpp/plugin.py +++ b/src/pytest_cpp/plugin.py @@ -133,7 +133,7 @@ def __init__( self._arguments = arguments @classmethod - def from_parent( # type:ignore[override] + def from_parent( # type: ignore[override] cls, *, parent: pytest.Collector, @@ -175,7 +175,7 @@ def __init__( self._arguments = arguments @classmethod - def from_parent( # type:ignore[override] + def from_parent( # type: ignore[override] cls, *, parent: pytest.Collector, @@ -204,7 +204,7 @@ def runtest(self) -> None: if failures: raise CppFailureError(failures) - def repr_failure( # type:ignore[override] + def repr_failure( # type: ignore[override] self, excinfo: pytest.ExceptionInfo[BaseException] ) -> str | TerminalRepr | CppFailureRepr: if isinstance(excinfo.value, CppFailureError): diff --git a/tests/test_pytest_cpp.py b/tests/test_pytest_cpp.py index d16075e..7122383 100644 --- a/tests/test_pytest_cpp.py +++ b/tests/test_pytest_cpp.py @@ -342,12 +342,10 @@ def test_cpp_files_option(testdir, exes): result = testdir.runpytest("--collect-only") result.stdout.fnmatch_lines("* no tests *") - testdir.makeini( - """ + testdir.makeini(""" [pytest] cpp_files = gtest* boost* - """ - ) + """) result = testdir.runpytest("--collect-only") result.stdout.fnmatch_lines( [ @@ -364,12 +362,10 @@ def test_cpp_files_option(testdir, exes): def test_cpp_ignore_py_files(testdir, exes): file_name = "cpptest_success.py" exes.get("gtest", "cpptest_success.py") - testdir.makeini( - """ + testdir.makeini(""" [pytest] cpp_files = cpptest_* - """ - ) + """) result = testdir.runpytest("--collect-only") result.stdout.fnmatch_lines("* no tests *") @@ -388,24 +384,20 @@ def test_cpp_ignore_py_files(testdir, exes): def test_google_one_argument(testdir, exes): - testdir.makeini( - """ + testdir.makeini(""" [pytest] cpp_arguments = argument1 - """ - ) + """) result = testdir.inline_run(exes.get("gtest_args"), "-k", "ArgsTest.one_argument") assert_outcomes(result, [("ArgsTest.one_argument", "passed")]) def test_google_two_arguments(testdir, exes): - testdir.makeini( - """ + testdir.makeini(""" [pytest] cpp_arguments = argument1 argument2 - """ - ) + """) result = testdir.inline_run(exes.get("gtest_args"), "-k", "ArgsTest.two_arguments") assert_outcomes(result, [("ArgsTest.two_arguments", "passed")]) @@ -434,12 +426,10 @@ def test_google_two_arguments_via_option(testdir, exes): def test_argument_option_priority(testdir, exes): - testdir.makeini( - """ + testdir.makeini(""" [pytest] cpp_arguments = argument2 - """ - ) + """) result = testdir.inline_run( exes.get("gtest_args"), "-k", @@ -466,24 +456,20 @@ def test_google_cpp_harness_via_option(testdir, exes): def test_boost_one_argument(testdir, exes): - testdir.makeini( - """ + testdir.makeini(""" [pytest] cpp_arguments = argument1 - """ - ) + """) result = testdir.inline_run(exes.get("boost_one_argument")) assert_outcomes(result, [("boost_one_argument", "passed")]) def test_boost_two_arguments(testdir, exes): - testdir.makeini( - """ + testdir.makeini(""" [pytest] cpp_arguments = argument1 argument2 - """ - ) + """) result = testdir.inline_run(exes.get("boost_two_arguments")) assert_outcomes(result, [("boost_two_arguments", "passed")]) @@ -569,12 +555,10 @@ def test_output_section(testdir, exes): exes.get("boost_failure") exes.get("gtest") - testdir.makeini( - """ + testdir.makeini(""" [pytest] cpp_files = gtest* boost* - """ - ) + """) result = testdir.runpytest("-k", "failure") result.stdout.fnmatch_lines( [ @@ -589,12 +573,10 @@ def test_cpp_verbose(testdir, exes): exes.get("boost_success") exes.get("gtest") - testdir.makeini( - """ + testdir.makeini(""" [pytest] cpp_files = gtest* boost* - """ - ) + """) result = testdir.runpytest("-k", "success", "-s", "-o", "cpp_verbose=true") result.stdout.fnmatch_lines( ["*Just saying hi from boost", "*Just saying hi from gtest"]