Skip to content

Commit

Permalink
Changes to appease ruff linter
Browse files Browse the repository at this point in the history
  • Loading branch information
micahellison committed Oct 1, 2024
1 parent ab78a09 commit dc05e29
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/lib/given_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from datetime import datetime
from unittest.mock import MagicMock
from unittest.mock import patch
from xml.etree import ElementTree
from xml.etree import ElementTree as ET

from pytest_bdd import given
from pytest_bdd.parsers import parse
Expand Down Expand Up @@ -168,7 +168,7 @@ def parse_output_as_language(cli_run, language_name):
actual_output = cli_run["stdout"]

if language_name == "XML":
parsed_output = ElementTree.fromstring(actual_output)
parsed_output = ET.fromstring(actual_output)
elif language_name == "JSON":
parsed_output = json.loads(actual_output)
else:
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/then_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
import os
import re
from xml.etree import ElementTree
from xml.etree import ElementTree as ET

from pytest_bdd import then
from pytest_bdd.parsers import parse
Expand Down Expand Up @@ -300,7 +300,7 @@ def cache_dir_contains_files(file_list, cache_dir):
def assert_output_is_valid_language(cli_run, language_name):
language_name = language_name.upper()
if language_name == "XML":
xml_tree = ElementTree.fromstring(cli_run["stdout"])
xml_tree = ET.fromstring(cli_run["stdout"])
assert xml_tree, "Invalid XML"
elif language_name == "JSON":
assert json.loads(cli_run["stdout"]), "Invalid JSON"
Expand Down Expand Up @@ -390,7 +390,7 @@ def assert_output_field_content(field_name, comparison, expected_keys, parsed_ou
@then(parse('there should be {number:d} "{item}" elements'))
def count_elements(number, item, cli_run):
actual_output = cli_run["stdout"]
xml_tree = ElementTree.fromstring(actual_output)
xml_tree = ET.fromstring(actual_output)
assert len(xml_tree.findall(".//" + item)) == number


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_parse_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class TestDeserialization:
)
def test_deserialize_multiword_strings(self, input_str):
runtime_config = make_yaml_valid_dict(input_str)
assert runtime_config.__class__ == dict
assert runtime_config.__class__ is dict
assert input_str[0] in runtime_config
assert runtime_config[input_str[0]] == input_str[1]

Expand Down

0 comments on commit dc05e29

Please sign in to comment.