Skip to content

Commit d9bbb3e

Browse files
committed
Fix ruff action
1 parent cee61d2 commit d9bbb3e

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
pip install --upgrade ruff
2525
- name: Lint with ruff
2626
run: |
27-
ruff . --output-format github
27+
ruff check . --output-format github
2828
2929
PyLint:
3030
runs-on: ubuntu-latest

exec_helpers/_ssh_base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,11 +1773,11 @@ def get_result(remote: SSHClientBase) -> exec_result.ExecResult:
17731773
for remote, future in futures.items():
17741774
try:
17751775
result = future.result(timeout=0.1)
1776-
results[(remote.hostname, remote.port)] = result
1776+
results[remote.hostname, remote.port] = result
17771777
if result.exit_code not in prep_expected:
1778-
errors[(remote.hostname, remote.port)] = result
1778+
errors[remote.hostname, remote.port] = result
17791779
except Exception as e: # noqa: PERF203
1780-
raised_exceptions[(remote.hostname, remote.port)] = e
1780+
raised_exceptions[remote.hostname, remote.port] = e
17811781

17821782
if raised_exceptions: # always raise
17831783
raise exceptions.ParallelCallExceptionsError(

exec_helpers/exec_result.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
lxml = None # pylint: disable=invalid-name
5151

5252
if typing.TYPE_CHECKING:
53-
import xml.etree.ElementTree # nosec # for typing only
53+
import xml.etree.ElementTree as ET # nosec # for typing only
5454
from collections.abc import Callable
5555
from collections.abc import Collection
5656
from collections.abc import Iterable
@@ -677,7 +677,7 @@ def stdout_yaml(self) -> typing.Any:
677677
# noinspection PyUnresolvedReferences
678678
@property
679679
@_handle_deserialize("xml")
680-
def stdout_xml(self) -> xml.etree.ElementTree.Element:
680+
def stdout_xml(self) -> ET.Element:
681681
"""XML from stdout.
682682
683683
:return: Decoded XML document.

test/test_exec_result.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
import datetime
2424
import unittest
25-
import xml.etree.ElementTree
25+
import xml.etree.ElementTree as ET
2626
from unittest import mock
2727

2828
import exec_helpers
@@ -297,10 +297,10 @@ def test_indexed_lines_access(self):
297297
def test_stdout_xml(self):
298298
"""Test xml etree decode."""
299299
result = exec_helpers.ExecResult("test", stdout=[b"<?xml version='1.0'?>\n", b"<data>123</data>\n"])
300-
expect = xml.etree.ElementTree.fromstring(b"<?xml version='1.0'?>\n<data>123</data>\n")
300+
expect = ET.fromstring(b"<?xml version='1.0'?>\n<data>123</data>\n")
301301
self.assertEqual(
302-
xml.etree.ElementTree.tostring(expect),
303-
xml.etree.ElementTree.tostring(result.stdout_xml),
302+
ET.tostring(expect),
303+
ET.tostring(result.stdout_xml),
304304
)
305305

306306
@unittest.skipIf(lxml is None, "no lxml installed")

0 commit comments

Comments
 (0)