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

Update conftest and readme

parent 2d758462
No related merge requests found
...@@ -21,7 +21,7 @@ import numpy as np ...@@ -21,7 +21,7 @@ import numpy as np
f, g = ps.fields("f, g : [2D]") f, g = ps.fields("f, g : [2D]")
stencil = ps.Assignment(g[0, 0], stencil = ps.Assignment(g[0, 0],
(f[1, 0] + f[-1, 0] + f[0, 1] + f[0, -1]) / 4) (f[1, 0] + f[-1, 0] + f[0, 1] + f[0, -1]) / 4)
kernel = ps.create_kernel(stencil).compile() kernel = ps.create_kernel(stencil).compile()
f_arr = np.random.rand(1000, 1000) f_arr = np.random.rand(1000, 1000)
......
...@@ -152,8 +152,7 @@ class IPyNbFile(pytest.File): ...@@ -152,8 +152,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)
# pytest v 2.4>: yield IPyNbTest.from_parent(name=self.name, parent=self, code=code)
def teardown(self): def teardown(self):
pass pass
...@@ -162,5 +161,4 @@ class IPyNbFile(pytest.File): ...@@ -162,5 +161,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)
# pytest v 2.4 >: return IPyNbFile.from_parent(fspath=path, parent=parent)
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