Total Complexity | 2 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
2 | # vim:fileencoding=utf-8 |
||
3 | # |
||
4 | # Copyright (c) 2020 Stefan Bender |
||
5 | # |
||
6 | # This module is part of sciapy. |
||
7 | # sciapy is free software: you can redistribute it or modify |
||
8 | # it under the terms of the GNU General Public License as published |
||
9 | # by the Free Software Foundation, version 2. |
||
10 | # See accompanying LICENSE file or http://www.gnu.org/licenses/gpl-2.0.html. |
||
11 | """Sciapy test fixtures |
||
12 | |||
13 | Test fixtures to run tests in a clean environment. |
||
14 | """ |
||
15 | import shutil |
||
16 | import tempfile |
||
17 | |||
18 | import pytest |
||
19 | |||
20 | |||
21 | def pytest_configure(config): |
||
22 | config.addinivalue_line( |
||
23 | "markers", "long: tests that need probably a bit longer to run." |
||
24 | ) |
||
25 | |||
26 | |||
27 | @pytest.fixture(scope="session") |
||
28 | def tmpdir(): |
||
29 | tmpdir = tempfile.mkdtemp() |
||
30 | yield tmpdir |
||
31 | shutil.rmtree(tmpdir) |
||
32 |