aboutsummaryrefslogtreecommitdiff
blob: 3262e0a5adf6ad41891a5de5ff2b4814e8b92000 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""snakeoil-based pytest fixtures"""

import pytest

from . import random_str


class TempDir(object):
    """Provide temporary directory to every test method."""

    @pytest.fixture(autouse=True)
    def __setup(self, tmpdir):
        self.dir = str(tmpdir)


class RandomPath(object):
    """Provide random path in a temporary directory to every test method."""

    @pytest.fixture(autouse=True)
    def __setup(self, tmpdir):
        self.path = str(tmpdir.join(random_str(10)))