summaryrefslogtreecommitdiffstats
path: root/contrib/python/portalocker/py2/tests/conftest.py
blob: a92117e39516d2ad4ac7fc0966f3aa20e0b5aab7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import py
import pytest


@pytest.fixture
def tmpfile(tmpdir_factory):
    tmpdir = tmpdir_factory.mktemp('temp')
    filename = tmpdir.join('tmpfile')
    yield str(filename)
    try:
        filename.remove(ignore_errors=True)
    except (py.error.EBUSY, py.error.ENOENT):
        pass