Skip to content

Commit

Permalink
Replace deprecated function.
Browse files Browse the repository at this point in the history
  • Loading branch information
karajan1001 committed Sep 7, 2022
1 parent 4b7e67d commit 8e66845
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions t/unit/transport/test_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,8 @@ def callback2(message_data, message):
@t.skip.if_win32
class test_FilesystemLock:
def test_lock(self):
message_file = tempfile.mktemp()
with open(message_file, "w") as file_obj1, open(
message_file) as file_obj2:
file_obj1 = tempfile.NamedTemporaryFile()
with open(file_obj1.name) as file_obj2:
lock(file_obj1, LOCK_SH)
with pytest.raises(BlockingIOError):
lock(file_obj2, LOCK_EX | LOCK_NB)
Expand All @@ -255,6 +254,7 @@ def test_lock(self):
unlock(file_obj1)
lock(file_obj2, LOCK_EX)
unlock(file_obj2)
file_obj1.close()


@t.skip.if_win32
Expand Down

0 comments on commit 8e66845

Please sign in to comment.