Switch from python 3 only TemporaryDirectory to pytest's tmpdir
# 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 = [
{
