Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephan Seitz
pystencils
Commits
6534b9d5
Commit
6534b9d5
authored
Aug 05, 2020
by
Markus Holzer
Browse files
Update conftest and readme
parent
2d758462
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
6534b9d5
...
...
@@ -21,7 +21,7 @@ import numpy as np
f
,
g
=
ps
.
fields
(
"f, g : [2D]"
)
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
()
f_arr
=
np
.
random
.
rand
(
1000
,
1000
)
...
...
conftest.py
View file @
6534b9d5
...
...
@@ -152,8 +152,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
)
# pytest v 2.4>: yield IPyNbTest.from_parent(name=self.name, parent=self, code=code)
yield
IPyNbTest
.
from_parent
(
name
=
self
.
name
,
parent
=
self
,
code
=
code
)
def
teardown
(
self
):
pass
...
...
@@ -162,5 +161,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
)
# pytest v 2.4 >: return IPyNbFile.from_parent(fspath=path, parent=parent)
return
IPyNbFile
.
from_parent
(
fspath
=
path
,
parent
=
parent
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment