aboutsummaryrefslogtreecommitdiff
path: root/test/conftest.py
blob: 782f885fdea6f2ca1c4632858d8e8dbf77a480a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import pytest
from tempfile import TemporaryDirectory
import os
import os.path


@pytest.fixture
def testdir() -> str:
    return os.path.abspath(__file__)


@pytest.fixture
def project_root(testdir: str) -> str:
    return os.path.dirname(os.path.dirname(testdir))


@pytest.fixture
def testdata_dir(project_root: str) -> str:
    return os.path.join(project_root, 'testdata')


@pytest.fixture
def maildir(testdata_dir: str) -> str:
    return os.path.join(testdata_dir, 'mail')


@pytest.fixture
def tmpdir() -> TemporaryDirectory[str]:
    return TemporaryDirectory()