Skip to content

Commit

Permalink
Fix linux test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kinto-b committed Aug 8, 2024
1 parent 74b9a79 commit bdaae52
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Test CLI commands"""

from tempfile import TemporaryFile
from tempfile import NamedTemporaryFile
import os

import unittest
Expand Down Expand Up @@ -60,7 +60,7 @@ def helper_deck(self, file, words, expected, mock_card):
@patch("karten.cli.card_collect", side_effect=mock_card_collect)
def test_deck_file_fresh(self, mock_card):
"""Test deck command with a fresh file"""
with TemporaryFile("w+", delete=False) as file:
with NamedTemporaryFile("w+", delete=False) as file:
fp = file.name

words = ["some", "words"]
Expand All @@ -73,7 +73,7 @@ def test_deck_file_fresh(self, mock_card):
@patch("karten.cli.card_collect", side_effect=mock_card_collect)
def test_deck_some_fail(self, mock_card):
"""Test deck command with a fresh file"""
with TemporaryFile("w+", delete=False) as file:
with NamedTemporaryFile("w+", delete=False) as file:
fp = file.name

words = ["some", "fail", "words"]
Expand All @@ -87,7 +87,7 @@ def test_deck_some_fail(self, mock_card):
@patch("karten.cli.card_collect", side_effect=mock_card_collect)
def test_deck_all_fail(self, mock_card):
"""Test deck command with a fresh file"""
with TemporaryFile("w+", delete=False) as file:
with NamedTemporaryFile("w+", delete=False) as file:
fp = file.name

words = ["fail", "fail"]
Expand All @@ -100,7 +100,7 @@ def test_deck_all_fail(self, mock_card):
@patch("karten.cli.card_collect", side_effect=mock_card_collect)
def test_deck_file_append(self, mock_card):
"""Test deck command with a pre-existing file"""
with TemporaryFile("w+", delete=False) as file:
with NamedTemporaryFile("w+", delete=False) as file:
fp = file.name
# Add some content to the file
deck_write([card_format(mock_card_collect("first", None))], file)
Expand Down

0 comments on commit bdaae52

Please sign in to comment.