Skip to content

Commit

Permalink
refactor to use temporary directory
Browse files Browse the repository at this point in the history
  • Loading branch information
nosracd committed Dec 23, 2024
1 parent 8c2cc01 commit 5bc5584
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/python/test_python_module.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import lcm
from os import path, remove
from tempfile import NamedTemporaryFile
from os import path
from tempfile import TemporaryDirectory

CHANNEL = 'test/channel'
DATA = bytes(3)
Expand Down Expand Up @@ -34,8 +34,8 @@ def test_event():


def test_event_log():
with NamedTemporaryFile() as f:
filename = f.name
with TemporaryDirectory() as temp_dir:
filename = f'{temp_dir}/test.log'
# Create a log, write an event, and close it.
log = lcm.EventLog(filename, 'w', True)
assert log.mode == 'w'
Expand Down

0 comments on commit 5bc5584

Please sign in to comment.