LogarithmPlotter/tests/python/test_helper.py

17 lines
383 B
Python
Raw Normal View History

2024-09-17 22:31:17 +00:00
import pytest
2024-09-18 16:01:51 +00:00
from os import getcwd
2024-09-17 22:31:17 +00:00
from os.path import join
from tempfile import TemporaryDirectory
from LogarithmPlotter.util import config
2024-09-18 16:01:51 +00:00
pwd = getcwd()
2024-09-17 22:31:17 +00:00
@pytest.fixture()
2024-09-18 16:01:51 +00:00
def temporary():
2024-09-17 22:31:17 +00:00
directory = TemporaryDirectory()
config.CONFIG_PATH = join(directory.name, "config.json")
2024-09-18 16:01:51 +00:00
tmpfile = join(directory.name, "graph.png")
2024-09-17 22:31:17 +00:00
yield tmpfile
2024-09-18 16:01:51 +00:00
directory.cleanup()