Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephan Seitz
pystencils
Commits
eda5d775
Commit
eda5d775
authored
Aug 05, 2020
by
Markus Holzer
Browse files
ubuntu pipeline fix
parent
6534b9d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
conftest.py
View file @
eda5d775
...
...
@@ -25,6 +25,12 @@ except ImportError:
SCRIPT_FOLDER
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
'pystencils'
))
# the Ubuntu pipeline uses an older version of pytest which uses deprecated functionality.
# This leads to many warinings in the test and coverage pipeline.
pytest_numeric_version
=
[
int
(
x
,
10
)
for
x
in
pytest
.
__version__
.
split
(
'.'
)]
pytest_numeric_version
.
reverse
()
pytest_version
=
sum
(
x
*
(
100
**
i
)
for
i
,
x
in
enumerate
(
pytest_numeric_version
))
def
add_path_to_ignore
(
path
):
if
not
os
.
path
.
exists
(
path
):
...
...
@@ -152,7 +158,10 @@ 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
.
from_parent
(
name
=
self
.
name
,
parent
=
self
,
code
=
code
)
if
pytest_version
>=
50403
:
yield
IPyNbTest
.
from_parent
(
name
=
self
.
name
,
parent
=
self
,
code
=
code
)
else
:
yield
IPyNbTest
(
self
.
name
,
self
,
code
)
def
teardown
(
self
):
pass
...
...
@@ -161,4 +170,7 @@ 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
.
from_parent
(
fspath
=
path
,
parent
=
parent
)
if
pytest_version
>=
50403
:
return
IPyNbFile
.
from_parent
(
fspath
=
path
,
parent
=
parent
)
else
:
return
IPyNbFile
(
path
,
parent
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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