Cannot import from conftest
MODIFY
tests/conftest.py
tests/conftest.py
@@ -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):

MODIFY
tests/test_subdir.py
tests/test_subdir.py
@@ -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')

Cannot import from conftest