Peano
Loading...
Searching...
No Matches
conftest.py
Go to the documentation of this file.
1"""!
2Repository-wide pytest configuration for everything under tests/
3
4Some ExaParty experiment scripts are called test_*.py but are command-line
5generator scripts, not pytest modules. Importing them would run the
6generator, so we exclude them from collection. Their pytest entry point is
7tests/exaparty/test_exaparty.py.
8"""
9
10import tempfile
11from pathlib import Path
12
13collect_ignore_glob = [
14 "exaparty/*/test_periodic_BC-*.py",
15 "exaparty/*/test_smoothing_length_computation_*.py",
16]
17
18
19def pytest_configure(config):
20 """!
21 Write the log of peano4.api.Logger into a temporary directory
22
23 The logger flushes its log into log.md in the current working directory
24 when the interpreter exits. Without this hook, every pytest run would
25 leave a log-<timestamp>.md file in the repository root.
26 """
27 from peano4.api.Logger import Logger
28
29 Logger().file_name = str(Path(tempfile.mkdtemp(prefix="peano-log-")) / "log.md")
Singleton logger for the Peano 4 Python API.
Definition Logger.py:37
pytest_configure(config)
Write the log of peano4.api.Logger into a temporary directory.
Definition conftest.py:19