Skip to content

Commit

Permalink
Linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wwakabobik committed Aug 30, 2024
1 parent 3a1d559 commit d299bee
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ def compare(actual: str, expected: str, threshold: int = 10) -> bool:
diff_pixels = sum(abs(r - g) + abs(g - b) + abs(b - a) + abs(a - r) > 20 for r, g, b, a in diff.getdata())

# Check that the number of different pixels is below the threshold
print(diff_pixels)
return diff_pixels < threshold

return compare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_draw_automation_state_report_creates_file(case_stat, case_stat_random,
remove(filename)


@pytest.mark.xfail("Image may differ on GA env")
@pytest.mark.xfail(reason="Image may differ on GA env")
def test_draw_automation_state_report_creates_correct_image(
random_expected_image, compare_image # pylint: disable=W0621
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_draw_history_state_chart_trace1_decor():
return # not implemented yet


def test_draw_history_state_chart_trace2_decor(random_plotly_reporter, compare_image):
def test_draw_history_state_chart_trace2_decor():
"""Init PlotlyReporter and call draw_history_state_chart with custom trace2 decor"""
return # not implemented yet

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_draw_test_case_by_area_creates_file(case_stat, case_stat_random, random
remove(filename)


@pytest.mark.xfail("Image may differ on GA env")
@pytest.mark.xfail(reason="Image may differ on GA env")
def test_draw_test_case_by_area_creates_correct_image(random_expected_image, compare_image): # pylint: disable=W0621
"""
Init PlotlyReporter and call draw_test_case_by_area with valid parameters should create correct image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_draw_test_case_by_priority_creates_file(random_plotly_reporter):
remove(filename)


@pytest.mark.xfail("Image may differ on GA env")
@pytest.mark.xfail(reason="Image may differ on GA env")
def test_draw_test_case_by_priority_creates_correct_image(compare_image, random_plotly_reporter):
"""
Init PlotlyReporter and call draw_test_case_by_priority with valid parameters should create correct image
Expand Down
4 changes: 2 additions & 2 deletions tests/utils/test_reporter_utils_logger_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from logging import DEBUG, INFO, WARNING, ERROR, FATAL, FileHandler, StreamHandler
from os import path, remove
from random import choice, randint
from random import choice

from faker import Faker

Expand All @@ -28,7 +28,7 @@ def test_setup_logger_default_level(caplog):
assert isinstance(logger.handlers[0], FileHandler)
assert isinstance(logger.handlers[1], StreamHandler)

message = str(fake.random_letters(randint(1, 10))) * randint(1, 10)
message = fake.name()
logger.debug(message)
with open(log_file, "r", encoding="utf-8") as readable_file:
assert message in readable_file.read()
Expand Down

0 comments on commit d299bee

Please sign in to comment.