From 08163eb46947452323a0c0910cb596efa2b489bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Bre=C3=9Fler?= Date: Tue, 7 May 2024 17:13:48 +0200 Subject: [PATCH 1/3] Allow GH action to be triggered manually --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f2a5f03..3524778 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,6 +7,8 @@ on: - 'v*' pull_request: + workflow_dispatch: + jobs: pre-commit: From 961270a81b1c7aabf073b9ffd904ef8ecf43ba07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Bre=C3=9Fler?= Date: Tue, 7 May 2024 18:17:20 +0200 Subject: [PATCH 2/3] work around PermissionErrors in /tmp dirs by test_run_fail() test --- tox.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tox.ini b/tox.ini index c1c9160..66a7458 100644 --- a/tox.ini +++ b/tox.ini @@ -36,3 +36,6 @@ nb_diff_replace = /cells/*/outputs/*/text plugins\:\s.*\n "plugin info ...\n" /cells/*/outputs/*/text "exec_cwd\=\\\'\/([A-z0-9-_+]+\/)*[A-z0-9-_+]+\\\'" "exec_cwd=/.../" /cells/*/outputs/*/traceback \ "" + +# work around PermissionErrors in /tmp dirs by test_run_fail() test +addopts = --basetemp=tmp From f5b47839b638acaa1d68bfaac5458328b82ee8fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Bre=C3=9Fler?= Date: Tue, 7 May 2024 18:25:56 +0200 Subject: [PATCH 3/3] tests: add the expected diff_replace loaded from pytest config in tox.ini --- tests/test_plugin_fixture.py | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/test_plugin_fixture.py b/tests/test_plugin_fixture.py index c98c927..5648064 100644 --- a/tests/test_plugin_fixture.py +++ b/tests/test_plugin_fixture.py @@ -67,6 +67,44 @@ def test_nb(nb_regression): # the following are the defaults for pytest-cov "cov_source": (), "cov_config": ".coveragerc", + # expected diff_replace loaded from pytest config in tox.ini + "diff_replace": ( + ( + "/cells/*/outputs/*/text", + "\\/([A-z0-9-_+]+\\/)*[A-z0-9-_+]+\\.ipynb", + "/.../.ipynb", + ), + ( + "/cells/*/outputs/*/text", + "rootdir\\:\\s\\/([A-z0-9-_+]+\\/)*[A-z0-9-_+]+", + "rootdir: /.../", + ), + ( + "/cells/*/outputs/*/text", + "in\\s[\\.0-9]+\\sseconds", + "in xxx seconds", + ), + ( + "/cells/*/outputs/*/text", + "platform\\s(darwin|linux).*\\n", + "platform info ...\\n", + ), + ( + "/cells/*/outputs/*/text", + "plugins\\:\\s.*\\n", + "plugin info ...\\n", + ), + ( + "/cells/*/outputs/*/text", + "exec_cwd\\=\\\\\\'\\/([A-z0-9-_+]+\\/)*[A-z0-9-_+]+\\\\\\'", + "exec_cwd=/.../", + ), + ( + "/cells/*/outputs/*/traceback", + "\\", + "", + ), + ), } ) )