From 36d2fb42fcea81e2d5b14034d10298ec51bb7d08 Mon Sep 17 00:00:00 2001 From: Long Vu Date: Mon, 17 May 2021 17:44:28 -0400 Subject: [PATCH 1/2] test: (not working) ignore by default html and javascript output to decrease usage of NBVAL_IGNORE_OUTPUT Following https://nbval.readthedocs.io/en/latest/index.html?highlight=skip#Skipping-certain-output-types Error: ``` INTERNALERROR> File "/opt/conda/envs/birdy/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result INTERNALERROR> raise ex[1].with_traceback(ex[2]) INTERNALERROR> File "/opt/conda/envs/birdy/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall INTERNALERROR> res = hook_impl.function(*args) INTERNALERROR> File "/repos/PAVICS-e2e-workflow-tests/conftest.py", line 2, in pytest_collectstart INTERNALERROR> collector.skip_compare += 'text/html', 'application/javascript', INTERNALERROR> AttributeError: 'Session' object has no attribute 'skip_compare' ``` --- conftest.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 conftest.py diff --git a/conftest.py b/conftest.py new file mode 100644 index 00000000..780b610b --- /dev/null +++ b/conftest.py @@ -0,0 +1,2 @@ +def pytest_collectstart(collector): + collector.skip_compare += 'text/html', 'application/javascript', From e31a2a12ad9a6210c785f5e60f8e8b49ce487c17 Mon Sep 17 00:00:00 2001 From: Long Vu Date: Tue, 18 May 2021 14:55:25 -0400 Subject: [PATCH 2/2] test: good fix to ignore by default html and javascript output to decrease usage of NBVAL_IGNORE_OUTPUT Fix the error found in the previous commit 36d2fb42fcea81e2d5b14034d10298ec51bb7d08. --- conftest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index 780b610b..2499bd39 100644 --- a/conftest.py +++ b/conftest.py @@ -1,2 +1,3 @@ def pytest_collectstart(collector): - collector.skip_compare += 'text/html', 'application/javascript', + if collector.fspath and collector.fspath.ext == '.ipynb': + collector.skip_compare += 'text/html', 'application/javascript',