From f99e6accdccdc972e3c75aac3bcb8cca75851070 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Fri, 28 Jul 2023 16:27:52 -0700 Subject: [PATCH] Making lint happy --- launchable/test_runners/nunit.py | 46 +++++++++++++++++--------------- tests/test_runners/test_nunit.py | 3 ++- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/launchable/test_runners/nunit.py b/launchable/test_runners/nunit.py index 3d303bff8..b0a706227 100644 --- a/launchable/test_runners/nunit.py +++ b/launchable/test_runners/nunit.py @@ -14,24 +14,25 @@ # nested s """ - Nested class name handling in .NET - --------------------------------- - - Nested class 'Zot' in the following example gets the full name "Foo.Bar+Zot": - - namespace Foo { - class Bar { - class Zot { - }}} - - This is incontrast to how you refer to this class from the source code. For example, - "new Foo.Bar.Zot()" - - The subset command expects the list of tests to be passed to "nunit --testlist" option, - and this option expects test names to be in "Foo.Bar+Zot" format. - +Nested class name handling in .NET +--------------------------------- + +Nested class 'Zot' in the following example gets the full name "Foo.Bar+Zot": + + namespace Foo { + class Bar { + class Zot { + }}} + +This is incontrast to how you refer to this class from the source code. For example, +"new Foo.Bar.Zot()" + +The subset command expects the list of tests to be passed to "nunit --testlist" option, +and this option expects test names to be in "Foo.Bar+Zot" format. + """ + def build_path(e: Element): pp = [] # type: TestPath if e.parent: @@ -47,13 +48,14 @@ def build_path(e: Element): if idx >= 0: # when things are going well, method name cannot contain '.' since it's not a valid character in a symbol. # but when NUnitXML.Logger messes up, it ends up putting the class name and the method name, like - # 0: def split_filepath(path: str) -> List[str]: diff --git a/tests/test_runners/test_nunit.py b/tests/test_runners/test_nunit.py index 56a1098aa..cfbe521ff 100644 --- a/tests/test_runners/test_nunit.py +++ b/tests/test_runners/test_nunit.py @@ -194,7 +194,8 @@ def test_record_test_with_nunit_reporter_bug(self): payload = json.loads(gzip.decompress(responses.calls[1].request.body).decode()) - # turns out we collapse all TestFixtures to TestSuitest so the golden file has TestSuite=Outer+Inner, not TestFixture=Outer+Inner + # turns out we collapse all TestFixtures to TestSuitest so the golden file has TestSuite=Outer+Inner, + # not TestFixture=Outer+Inner expected = self.load_json_from_file(self.test_files_dir.joinpath("nunit-reporter-bug-with-nested-type.json")) self.assert_json_orderless_equal(expected, payload)