Skip to content

Commit

Permalink
fix: linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
matveypashkovskiy committed Mar 31, 2021
1 parent d5dd6f5 commit 030bc32
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pytest_rts/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import pytest
from _pytest.nodes import Item

from pytest_rts.utils.common import filter_pytest_items, strip_pytest_cov_testname, intersect_with_surroundings
from pytest_rts.utils.common import (
filter_pytest_items, strip_pytest_cov_testname, intersect_with_surroundings
)


@pytest.mark.parametrize(
Expand Down Expand Up @@ -75,5 +77,8 @@ def get_closest_marker(self, markername: str) -> bool:


def test_intersect_with_surroundings() -> None:
"""
Tests that non mapped lines are handled properly
"""
res = intersect_with_surroundings({1, 5, 21, 30}, {2, 3, 10, 11, 12, 20, 21, 22})
assert res == {2, 3, 10, 21, 22}
3 changes: 2 additions & 1 deletion pytest_rts/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def get_tests_from_changes(
def intersect_with_surroundings(changed_lines: Set[int], mapped_lines: Set[int]) -> Set[int]:
"""
Finds lines existing in both changed_lines and mapped_lines.
For lines that exist in changed_lines but not in mapped_lines looks for the closest mapped lines from left and right
For lines that exist in changed_lines but not in mapped_lines
looks for the closest mapped lines from left and right
hand sides - mapped lines which surround changed line.
Example:
Expand Down

0 comments on commit 030bc32

Please sign in to comment.