Skip to content

Commit

Permalink
tests: fix test_sigint on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Kraymer committed Dec 26, 2020
1 parent 3863dff commit 8811be2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/mock_inputs_test.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import unittest
import tempfile
import io
import os

from mock import patch

import qifqif
from qifqif import qifile
import testdata

OUT_FILE = tempfile.NamedTemporaryFile()
OUT_FILE = tempfile.NamedTemporaryFile(delete=False)
OPTIONS = qifqif.parse_args(["qifqif", "-d", "-c", testdata.CFG_FILE, "dummy"])


Expand Down Expand Up @@ -82,8 +83,10 @@ def test_revert_on_eof(self, mock_quick_input):
def test_sigint(self, mock_quick_input):
"""Check that processed transactions are not lost on interruption."""
qifqif.main()
OUT_FILE.close()
with io.open(OUT_FILE.name, "r", encoding="utf-8") as fin:
res = qifile.parse_lines(fin.readlines())
os.unlink(OUT_FILE.name)
self.assertEqual(res[0]["category"], "Drink")


Expand Down

0 comments on commit 8811be2

Please sign in to comment.