Skip to content

Commit b713430

Browse files
committed
tests: fixed Sourcery smells
1 parent 59c2259 commit b713430

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

mss/tests/test_gnu_linux.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,9 @@ def find_lib_mocked(lib):
109109

110110
def test_region_out_of_monitor_bounds():
111111
display = os.getenv("DISPLAY")
112-
monitor = {"left": -30, "top": 0, "width": 100, "height": 100}
113-
114112
with mss.mss(display=display) as sct:
115113
with pytest.raises(ScreenShotError) as exc:
114+
monitor = {"left": -30, "top": 0, "width": 100, "height": 100}
116115
assert sct.grab(monitor)
117116

118117
assert str(exc.value)

mss/tests/test_leaks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,21 @@ def with_context_manager():
8282

8383
def regression_issue_128():
8484
"""Regression test for issue #128: areas overlap."""
85-
area1 = {"top": 50, "left": 7, "width": 400, "height": 320, "mon": 1}
86-
area2 = {"top": 200, "left": 200, "width": 320, "height": 320, "mon": 1}
8785
with mss() as sct:
86+
area1 = {"top": 50, "left": 7, "width": 400, "height": 320, "mon": 1}
8887
sct.grab(area1)
88+
area2 = {"top": 200, "left": 200, "width": 320, "height": 320, "mon": 1}
8989
sct.grab(area2)
9090

9191

9292
def regression_issue_135():
9393
"""Regression test for issue #135: multiple areas."""
94-
bounding_box_notes = {"top": 0, "left": 0, "width": 100, "height": 100}
95-
bounding_box_score = {"top": 110, "left": 110, "width": 100, "height": 100}
96-
bounding_box_test = {"top": 220, "left": 220, "width": 100, "height": 100}
9794
with mss() as sct:
95+
bounding_box_notes = {"top": 0, "left": 0, "width": 100, "height": 100}
9896
sct.grab(bounding_box_notes)
97+
bounding_box_test = {"top": 220, "left": 220, "width": 100, "height": 100}
9998
sct.grab(bounding_box_test)
99+
bounding_box_score = {"top": 110, "left": 110, "width": 100, "height": 100}
100100
sct.grab(bounding_box_score)
101101

102102

0 commit comments

Comments
 (0)