Skip to content

Commit

Permalink
Add FuseRunner to the runner list.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Clabaut committed Oct 11, 2015
1 parent b9e74fe commit c2bab6d
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import sys
import pytest
import os
Expand All @@ -9,7 +10,8 @@

__all__ = [ 'runner_list', 'assert_same_json', 'assert_json_equality']

runner_list = [StraceRunner, AtimesRunner]
runner_list = [StraceRunner, AtimesRunner,
FuseRunner]

@pytest.fixture(autouse=True)
def mock_env(request, mocker):
Expand Down Expand Up @@ -49,15 +51,27 @@ def run_exitfuncs():
return run_exitfuncs


@pytest.fixture
@pytest.fixture(scope='session')
def cleandir():
""" Sould the build directory be cleaned at the end of each test """
return True

@pytest.fixture(scope='session')
def builddir_root(cleandir, request):
""" Returns the buil root directory after having make it.
The directory is removed at the end of session if `cleandir` is True
"""
from tempfile import mkdtemp
tempdir = mkdtemp(suffix='builddir')
def fin():
if cleandir:
shutil.rmtree(tempdir, ignore_errors=True)
request.addfinalizer(fin)
return tempdir

@pytest.fixture
def builddir(request, cleandir):
bdir = os.path.join("build_dir", "%s-%s" % (request.module.__name__,
def builddir(request, cleandir, builddir_root):
bdir = os.path.join("/tmp/build_dir", "%s-%s" % (request.module.__name__,
request.function.__name__))
try:
shutil.rmtree(bdir)
Expand Down

0 comments on commit c2bab6d

Please sign in to comment.