kopia lustrzana https://github.com/jupyterhub/repo2docker
Cannot import from conftest
rodzic
2e63ec8704
commit
3ef8b4e934
|
@ -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):
|
||||
|
|
|
@ -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')
|
||||
|
|
Ładowanie…
Reference in New Issue