Fix the config tests

This commit is contained in:
mathieui 2018-07-21 16:46:50 +02:00
parent 79a4cc8937
commit a8fc35cf35
No known key found for this signature in database
GPG key ID: C59F84CEEFD616E3

View file

@ -2,17 +2,18 @@
Test the config module Test the config module
""" """
import tempfile
import pytest
import os import os
import tempfile
from pathlib import Path
import pytest
from poezio import config from poezio import config
@pytest.yield_fixture(scope="module") @pytest.yield_fixture(scope="module")
def config_obj(): def config_obj():
file_ = tempfile.NamedTemporaryFile(delete=False) file_ = tempfile.NamedTemporaryFile(delete=False)
conf = config.Config(file_name=file_.name) conf = config.Config(file_name=Path(file_.name))
yield conf yield conf
del conf del conf
os.unlink(file_.name) os.unlink(file_.name)