Skip to content
Snippets Groups Projects
Commit f888c012 authored by Markus Holzer's avatar Markus Holzer
Browse files

Fix pytest deprication and marker warnings

parent 7b060744
Branches
Tags
No related merge requests found
...@@ -151,7 +151,7 @@ class IPyNbFile(pytest.File): ...@@ -151,7 +151,7 @@ class IPyNbFile(pytest.File):
warnings.filterwarnings("ignore", "IPython.core.inputsplitter is deprecated") warnings.filterwarnings("ignore", "IPython.core.inputsplitter is deprecated")
notebook = nbformat.read(notebook_contents, 4) notebook = nbformat.read(notebook_contents, 4)
code, _ = exporter.from_notebook_node(notebook) 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): def teardown(self):
pass pass
...@@ -160,4 +160,4 @@ class IPyNbFile(pytest.File): ...@@ -160,4 +160,4 @@ class IPyNbFile(pytest.File):
def pytest_collect_file(path, parent): def pytest_collect_file(path, parent):
glob_exprs = ["*demo*.ipynb", "*tutorial*.ipynb", "test_*.ipynb"] glob_exprs = ["*demo*.ipynb", "*tutorial*.ipynb", "test_*.ipynb"]
if any(path.fnmatch(g) for g in glob_exprs): if any(path.fnmatch(g) for g in glob_exprs):
return IPyNbFile(path, parent) return IPyNbFile.from_parent(fspath=path, parent=parent)
...@@ -4,6 +4,7 @@ norecursedirs = *.egg-info .git .cache .ipynb_checkpoints htmlcov ...@@ -4,6 +4,7 @@ norecursedirs = *.egg-info .git .cache .ipynb_checkpoints htmlcov
addopts = --doctest-modules --durations=20 --cov-config pytest.ini addopts = --doctest-modules --durations=20 --cov-config pytest.ini
markers = markers =
kerncraft: tests depending on kerncraft kerncraft: tests depending on kerncraft
notebook: mark for notebooks
[run] [run]
branch = True branch = True
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment