Switch from python 3 only TemporaryDirectory to pytest's tmpdir

This commit is contained in:
Isaac Sijaranamual 2017-12-11 00:16:04 +01:00
parent f32c6630cb
commit 38021fbb00
1 changed files with 77 additions and 77 deletions

View File

@ -1,15 +1,15 @@
# coding: utf-8
from __future__ import unicode_literals
import json
from tempfile import TemporaryDirectory, NamedTemporaryFile
from tempfile import NamedTemporaryFile
from ...cli.train import train
def test_cli_trained_model_can_be_saved():
def test_cli_trained_model_can_be_saved(tmpdir):
cmd = None
lang = 'nl'
with TemporaryDirectory() as output_dir:
output_dir = str(tmpdir)
train_file = NamedTemporaryFile('wb', dir=output_dir, delete=False)
train_corpus = [
{