Skip to content

Commit

Permalink
Merge pull request #237 from jan-cerny/pylint_error
Browse files Browse the repository at this point in the history
Fix pylint problems
  • Loading branch information
Mab879 authored Jun 26, 2024
2 parents 4c53b29 + eae83e9 commit a46e16d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion openscap_report/dataclasses/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def _field_init(f, frozen, globals, self_name):
if f.default is MISSING:
# There's no default, just do an assignment.
value = f.name
elif f.default is not MISSING:
else:
globals[default_name] = f.default
value = f.name
else:
Expand Down
18 changes: 9 additions & 9 deletions tests/unit_tests/test_shared_static_methods_of_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,29 @@ def test_get_unique_id_in_dict(object_, dict_):


@pytest.mark.unit_test
@pytest.mark.parametrize("element, expect_key", [
@pytest.mark.parametrize("elem, expect_key", [
(etree.Element("xml_element"), "xml_element"),
(etree.Element("{}xml_element"), "xml_element"),
(etree.Element("{NAME_SPACE}xml_element"), "xml_element"),
])
def test_get_key_of_xml_element(element, expect_key):
key_element = SharedStaticMethodsOfParser.get_key_of_xml_element(element)
def test_get_key_of_xml_element(elem, expect_key):
key_element = SharedStaticMethodsOfParser.get_key_of_xml_element(elem)
assert key_element == expect_key


@pytest.fixture
def element(request):
@pytest.fixture(name="parametrized_element")
def fixture_parametrized_element(request):
e = etree.Element("xml_element")
e.text = request.param
return e


@pytest.mark.unit_test
@pytest.mark.parametrize("element, expected_text", [
@pytest.mark.parametrize("parametrized_element, expected_text", [
(None, ""),
("", ""),
("abcd", "abcd"),
], indirect=["element"])
def test_get_text_of_xml_element(element, expected_text):
text = SharedStaticMethodsOfParser.get_text_of_xml_element(element)
], indirect=["parametrized_element"])
def test_get_text_of_xml_element(parametrized_element, expected_text):
text = SharedStaticMethodsOfParser.get_text_of_xml_element(parametrized_element)
assert text == expected_text

0 comments on commit a46e16d

Please sign in to comment.