From ede074a44cce1a83d64d532694bd288c4998237b Mon Sep 17 00:00:00 2001 From: utensil Date: Thu, 28 Mar 2024 16:40:57 +0800 Subject: [PATCH 1/2] Work around warnings in stderr --- examples/ipython/conftest.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 examples/ipython/conftest.py diff --git a/examples/ipython/conftest.py b/examples/ipython/conftest.py new file mode 100644 index 00000000..e8b4d012 --- /dev/null +++ b/examples/ipython/conftest.py @@ -0,0 +1,4 @@ +# https://nbval.readthedocs.io/en/latest/#Skipping-certain-output-types +def pytest_collectstart(collector): + if collector.fspath and collector.fspath.ext == '.ipynb': + collector.skip_compare += 'text/html', 'application/javascript', 'stderr', \ No newline at end of file From 4c6efe8b25b01ab9d1a4f0f7f4a174a131f2bbf2 Mon Sep 17 00:00:00 2001 From: utensil Date: Thu, 28 Mar 2024 16:59:09 +0800 Subject: [PATCH 2/2] Update nbval options --current-env has been renamed to --nbval-current-env --sanitize-with has been renamed to --nbval-sanitize-with --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fb512d14..2b910a86 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ Further, to run the complete test suite including the ones using [nbval](https:/ ```bash pip install nbval -pytest --nbval examples/ipython/ test --current-env --sanitize-with test/.nbval_sanitize.cfg +pytest --nbval examples/ipython/ test --nbval-current-env --nbval-sanitize-with test/.nbval_sanitize.cfg ``` This could take more than 10 minutes, please be patient.