Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lbmpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
lbmpy
Commits
0e57aea4
Commit
0e57aea4
authored
4 years ago
by
Markus Holzer
Browse files
Options
Downloads
Patches
Plain Diff
Updated conftest due to new pytest version
parent
c97e4589
No related branches found
No related tags found
1 merge request
!38
Update conftest and readme
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
conftest.py
+14
-2
14 additions, 2 deletions
conftest.py
with
14 additions
and
2 deletions
conftest.py
+
14
−
2
View file @
0e57aea4
...
@@ -21,6 +21,12 @@ from lbmpy.phasefield.simplex_projection import simplex_projection_2d # NOQA
...
@@ -21,6 +21,12 @@ from lbmpy.phasefield.simplex_projection import simplex_projection_2d # NOQA
SCRIPT_FOLDER
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
SCRIPT_FOLDER
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
'
lbmpy
'
))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
'
lbmpy
'
))
# 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
):
def
add_path_to_ignore
(
path
):
if
not
os
.
path
.
exists
(
path
):
if
not
os
.
path
.
exists
(
path
):
...
@@ -121,7 +127,10 @@ class IPyNbFile(pytest.File):
...
@@ -121,7 +127,10 @@ 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
)
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
):
def
teardown
(
self
):
pass
pass
...
@@ -130,4 +139,7 @@ class IPyNbFile(pytest.File):
...
@@ -130,4 +139,7 @@ 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
)
if
pytest_version
>=
50403
:
return
IPyNbFile
.
from_parent
(
fspath
=
path
,
parent
=
parent
)
else
:
return
IPyNbFile
(
path
,
parent
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment