Skip to content

Commit dac8c57

Browse files
committed
tests: fix test_entry_point() with multiple monitors having the same resolution
1 parent f53aa90 commit dac8c57

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CHANGELOG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ History:
33
<see Git checking messages for history>
44

55
8.0.1 2023/xx/xx
6-
-
6+
- tests: fix test_entry_point() with multiple monitors having the same resolution
77

88
8.0.0 2023/04/09
99
- removed support for Python 3.6

mss/tests/test_implementation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ def test_entry_point(capsys):
9696
assert os.path.isfile("monitor-1.png")
9797
os.remove("monitor-1.png")
9898

99-
fmt = "sct-{width}x{height}.png"
99+
fmt = "sct-{mon}-{width}x{height}.png"
100100
for opt in ("-o", "--out"):
101101
main([opt, fmt])
102102
out, _ = capsys.readouterr()
103103
with mss(display=os.getenv("DISPLAY")) as sct:
104-
for monitor, line in zip(sct.monitors[1:], out.splitlines()):
105-
filename = fmt.format(**monitor)
104+
for mon, (monitor, line) in enumerate(zip(sct.monitors[1:], out.splitlines()), 1):
105+
filename = fmt.format(mon=mon, **monitor)
106106
assert line.endswith(filename)
107107
assert os.path.isfile(filename)
108108
os.remove(filename)

0 commit comments

Comments
 (0)