LogarithmPlotter/tests/python/test_helper.py

35 lines
1.2 KiB
Python
Raw Normal View History

"""
* LogarithmPlotter - 2D plotter software to make BODE plots, sequences and distribution functions.
* Copyright (C) 2021-2024 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
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()