diff --git a/conftest.py b/conftest.py index d6b74818a5d90824dc09ab6faf802ec86e77c1da..980df61cc202dee70db4f3e8b7788786d473fd88 100644 --- a/conftest.py +++ b/conftest.py @@ -151,7 +151,7 @@ class IPyNbFile(pytest.File): warnings.filterwarnings("ignore", "IPython.core.inputsplitter is deprecated") notebook = nbformat.read(notebook_contents, 4) code, _ = exporter.from_notebook_node(notebook) - yield IPyNbTest(self.name, self, code) + yield IPyNbTest.from_parent(name=self.name, parent=self, code=code) def teardown(self): pass @@ -160,4 +160,4 @@ class IPyNbFile(pytest.File): def pytest_collect_file(path, parent): glob_exprs = ["*demo*.ipynb", "*tutorial*.ipynb", "test_*.ipynb"] if any(path.fnmatch(g) for g in glob_exprs): - return IPyNbFile(path, parent) + return IPyNbFile.from_parent(fspath=path, parent=parent) diff --git a/pytest.ini b/pytest.ini index 0070425966626449378fcd1ff9eabe468256a112..ad6eb67d5e00832fd1c6860105b493a477834703 100644 --- a/pytest.ini +++ b/pytest.ini @@ -4,6 +4,7 @@ norecursedirs = *.egg-info .git .cache .ipynb_checkpoints htmlcov addopts = --doctest-modules --durations=20 --cov-config pytest.ini markers = kerncraft: tests depending on kerncraft + notebook: mark for notebooks [run] branch = True