[PATCH evemu 09/11] tests: Open temporary device file in text mode
Daniel Martin
consume.noise at gmail.com
Thu Jan 2 13:47:59 PST 2014
Open the temporary device file in text mode. Otherwise, conversions from
bytes to str objects will be necessary before passing the data to
strip_comments().
It even gets opened in read-only mode as this side just reads from the
file. It gets opened somewhere else for writing.
Signed-off-by: Daniel Martin <consume.noise at gmail.com>
---
python/evemu/tests/test_device.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/python/evemu/tests/test_device.py b/python/evemu/tests/test_device.py
index 81d5a00..4c7bf65 100644
--- a/python/evemu/tests/test_device.py
+++ b/python/evemu/tests/test_device.py
@@ -15,7 +15,7 @@ def record(recording_started, device_node, q):
blocking API.
"""
device = evemu.Device(device_node)
- with tempfile.TemporaryFile() as event_file:
+ with tempfile.TemporaryFile(mode='rt') as event_file:
recording_started.set()
device.record(event_file, 1000)
event_file.flush()
@@ -85,7 +85,7 @@ class DeviceActionTestCase(testcase.BaseTestCase):
d = evemu.Device(self.get_device_file())
# get the description to a temporary file
- with tempfile.TemporaryFile() as t:
+ with tempfile.TemporaryFile(mode='rt') as t:
d.describe(t)
# read in the temporary file and compare to the original
--
1.8.5.2
More information about the Input-tools
mailing list