Skip to content
Snippets Groups Projects
Commit e2b61455 authored by Martin Bauer's avatar Martin Bauer
Browse files

tests: suppress warnings from jupyter notebook runner

parent e1b452f7
No related merge requests found
Pipeline #20228 passed with warnings with stages
in 7 minutes and 51 seconds
...@@ -3,6 +3,7 @@ import pytest ...@@ -3,6 +3,7 @@ import pytest
import tempfile import tempfile
import runpy import runpy
import sys import sys
import warnings
# Trigger config file reading / creation once - to avoid race conditions when multiple instances are creating it # Trigger config file reading / creation once - to avoid race conditions when multiple instances are creating it
# at the same time # at the same time
from pystencils.cpu import cpujit from pystencils.cpu import cpujit
...@@ -128,8 +129,11 @@ class IPyNbFile(pytest.File): ...@@ -128,8 +129,11 @@ class IPyNbFile(pytest.File):
exporter.exclude_input_prompt = True exporter.exclude_input_prompt = True
notebook_contents = self.fspath.open() notebook_contents = self.fspath.open()
notebook = nbformat.read(notebook_contents, 4)
code, _ = exporter.from_notebook_node(notebook) with warnings.catch_warnings():
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) yield IPyNbTest(self.name, self, code)
def teardown(self): def teardown(self):
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
python_files = test_*.py *_test.py scenario_*.py python_files = test_*.py *_test.py scenario_*.py
norecursedirs = *.egg-info .git .cache .ipynb_checkpoints htmlcov 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 =
gpu: test that require a gpu
kerncraft: tests depending on kerncraft
[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