Skip to content

Commit 9fe49b0

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 7ec2f68 commit 9fe49b0

File tree

4 files changed

+21
-41
lines changed

4 files changed

+21
-41
lines changed

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from setuptools import setup
22

3-
43
setup(
54
name="pytest-cpp",
65
use_scm_version=True,

src/pytest_cpp/catch2.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from pytest_cpp.facade_abc import AbstractFacade
1616
from pytest_cpp.helpers import make_cmdline
1717

18-
1918
# Map each special character's Unicode ordinal to the escaped character.
2019
_special_chars_map: dict[int, str] = {i: "\\" + chr(i) for i in b'[]*,~\\"'}
2120

src/pytest_cpp/plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def __init__(
133133
self._arguments = arguments
134134

135135
@classmethod
136-
def from_parent( # type:ignore[override]
136+
def from_parent( # type: ignore[override]
137137
cls,
138138
*,
139139
parent: pytest.Collector,
@@ -175,7 +175,7 @@ def __init__(
175175
self._arguments = arguments
176176

177177
@classmethod
178-
def from_parent( # type:ignore[override]
178+
def from_parent( # type: ignore[override]
179179
cls,
180180
*,
181181
parent: pytest.Collector,
@@ -204,7 +204,7 @@ def runtest(self) -> None:
204204
if failures:
205205
raise CppFailureError(failures)
206206

207-
def repr_failure( # type:ignore[override]
207+
def repr_failure( # type: ignore[override]
208208
self, excinfo: pytest.ExceptionInfo[BaseException]
209209
) -> str | TerminalRepr | CppFailureRepr:
210210
if isinstance(excinfo.value, CppFailureError):

tests/test_pytest_cpp.py

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,10 @@ def test_cpp_files_option(testdir, exes):
342342
result = testdir.runpytest("--collect-only")
343343
result.stdout.fnmatch_lines("* no tests *")
344344

345-
testdir.makeini(
346-
"""
345+
testdir.makeini("""
347346
[pytest]
348347
cpp_files = gtest* boost*
349-
"""
350-
)
348+
""")
351349
result = testdir.runpytest("--collect-only")
352350
result.stdout.fnmatch_lines(
353351
[
@@ -364,12 +362,10 @@ def test_cpp_files_option(testdir, exes):
364362
def test_cpp_ignore_py_files(testdir, exes):
365363
file_name = "cpptest_success.py"
366364
exes.get("gtest", "cpptest_success.py")
367-
testdir.makeini(
368-
"""
365+
testdir.makeini("""
369366
[pytest]
370367
cpp_files = cpptest_*
371-
"""
372-
)
368+
""")
373369

374370
result = testdir.runpytest("--collect-only")
375371
result.stdout.fnmatch_lines("* no tests *")
@@ -388,24 +384,20 @@ def test_cpp_ignore_py_files(testdir, exes):
388384

389385

390386
def test_google_one_argument(testdir, exes):
391-
testdir.makeini(
392-
"""
387+
testdir.makeini("""
393388
[pytest]
394389
cpp_arguments = argument1
395-
"""
396-
)
390+
""")
397391

398392
result = testdir.inline_run(exes.get("gtest_args"), "-k", "ArgsTest.one_argument")
399393
assert_outcomes(result, [("ArgsTest.one_argument", "passed")])
400394

401395

402396
def test_google_two_arguments(testdir, exes):
403-
testdir.makeini(
404-
"""
397+
testdir.makeini("""
405398
[pytest]
406399
cpp_arguments = argument1 argument2
407-
"""
408-
)
400+
""")
409401

410402
result = testdir.inline_run(exes.get("gtest_args"), "-k", "ArgsTest.two_arguments")
411403
assert_outcomes(result, [("ArgsTest.two_arguments", "passed")])
@@ -434,12 +426,10 @@ def test_google_two_arguments_via_option(testdir, exes):
434426

435427

436428
def test_argument_option_priority(testdir, exes):
437-
testdir.makeini(
438-
"""
429+
testdir.makeini("""
439430
[pytest]
440431
cpp_arguments = argument2
441-
"""
442-
)
432+
""")
443433
result = testdir.inline_run(
444434
exes.get("gtest_args"),
445435
"-k",
@@ -466,24 +456,20 @@ def test_google_cpp_harness_via_option(testdir, exes):
466456

467457

468458
def test_boost_one_argument(testdir, exes):
469-
testdir.makeini(
470-
"""
459+
testdir.makeini("""
471460
[pytest]
472461
cpp_arguments = argument1
473-
"""
474-
)
462+
""")
475463

476464
result = testdir.inline_run(exes.get("boost_one_argument"))
477465
assert_outcomes(result, [("boost_one_argument", "passed")])
478466

479467

480468
def test_boost_two_arguments(testdir, exes):
481-
testdir.makeini(
482-
"""
469+
testdir.makeini("""
483470
[pytest]
484471
cpp_arguments = argument1 argument2
485-
"""
486-
)
472+
""")
487473

488474
result = testdir.inline_run(exes.get("boost_two_arguments"))
489475
assert_outcomes(result, [("boost_two_arguments", "passed")])
@@ -569,12 +555,10 @@ def test_output_section(testdir, exes):
569555
exes.get("boost_failure")
570556
exes.get("gtest")
571557

572-
testdir.makeini(
573-
"""
558+
testdir.makeini("""
574559
[pytest]
575560
cpp_files = gtest* boost*
576-
"""
577-
)
561+
""")
578562
result = testdir.runpytest("-k", "failure")
579563
result.stdout.fnmatch_lines(
580564
[
@@ -589,12 +573,10 @@ def test_cpp_verbose(testdir, exes):
589573
exes.get("boost_success")
590574
exes.get("gtest")
591575

592-
testdir.makeini(
593-
"""
576+
testdir.makeini("""
594577
[pytest]
595578
cpp_files = gtest* boost*
596-
"""
597-
)
579+
""")
598580
result = testdir.runpytest("-k", "success", "-s", "-o", "cpp_verbose=true")
599581
result.stdout.fnmatch_lines(
600582
["*Just saying hi from boost", "*Just saying hi from gtest"]

0 commit comments

Comments
 (0)