Cannot import from conftest

pull/413/head
Derek Ludwig 2018-09-26 15:33:52 -07:00
rodzic 2e63ec8704
commit 3ef8b4e934
2 zmienionych plików z 12 dodań i 3 usunięć

Wyświetl plik

@ -68,6 +68,14 @@ def make_test_func(args):
return test
# Provide a fixture for testing in .py files
@pytest.fixture()
def run_repo2docker():
def run_test(args):
return make_test_func(args)()
return run_test
class Repo2DockerTest(pytest.Function):
"""A pytest.Item for running repo2docker"""
def __init__(self, name, parent, args):

Wyświetl plik

@ -6,13 +6,14 @@ from os.path import abspath, dirname
import pytest
from repo2docker.app import Repo2Docker
from tests.conftest import make_test_func
repo_path = dirname(dirname(abspath(__file__)))
def test_subdir():
def test_subdir(run_repo2docker):
argv = ['--subdir', 'tests/conda/simple', repo_path]
make_test_func(argv)()
run_repo2docker(argv)
def test_subdir_invalid(caplog):
caplog.set_level(logging.INFO, logger='Repo2Docker')