Skip to content

Commit 11e2cb3

Browse files
committed
tests: fix a ResourceWarning: unclosed file
1 parent 51d0aa8 commit 11e2cb3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ History:
44

55
3.3.0 2018/08/xx
66
- Linux: add an error handler for the XServer to prevent interpreter crash (fix #61)
7+
- tests: fix a ResourceWarning: unclosed file
78
- big code clean-up using black
89

910
3.2.1 2018/05/21

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ def is_travis():
5353

5454
@pytest.fixture(scope="session")
5555
def raw():
56-
return open("tests/res/monitor-1024x768.raw", "rb").read()
56+
with open("tests/res/monitor-1024x768.raw", "rb") as f:
57+
yield f.read()

0 commit comments

Comments
 (0)