Skip to content

Commit cb517e9

Browse files
committed
tests: fix test_entry_point() when there are several monitors
1 parent 2b51323 commit cb517e9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ History:
66
- Mac: reduce the number of function calls
77
- Mac: support macOS Big Sur (fixes #178)
88
- tests: fix macOS intepreter not found on Travis-CI
9+
- tests: fix test_entry_point() when there are several monitors
910
- :heart: contributors: @
1011

1112
6.0.0 2020/06/30

mss/tests/test_implementation.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,12 @@ def test_entry_point(capsys, sct):
9696
fmt = "sct-{width}x{height}.png"
9797
for opt in ("-o", "--out"):
9898
main([opt, fmt])
99-
filename = fmt.format(**sct.monitors[1])
10099
out, _ = capsys.readouterr()
101-
assert out.endswith(filename + "\n")
102-
assert os.path.isfile(filename)
103-
os.remove(filename)
100+
for monitor, line in zip(sct.monitors[1:], out.splitlines()):
101+
filename = fmt.format(**monitor)
102+
assert line.endswith(filename)
103+
assert os.path.isfile(filename)
104+
os.remove(filename)
104105

105106
fmt = "sct_{mon}-{date:%Y-%m-%d}.png"
106107
for opt in ("-o", "--out"):

0 commit comments

Comments
 (0)