From 42178867db7a9f23a8c080568b37bbac9fc8807b Mon Sep 17 00:00:00 2001 From: Ryan Pilgrim Date: Wed, 22 Jul 2020 14:28:57 -0400 Subject: [PATCH 01/11] add very verbose option --- python-pytest.el | 1 + 1 file changed, 1 insertion(+) diff --git a/python-pytest.el b/python-pytest.el index 0b479e3..8aed112 100644 --- a/python-pytest.el +++ b/python-pytest.el @@ -133,6 +133,7 @@ When non-nil only ‘test_foo()’ will match, and nothing else." (?s "do not capture output" "--capture=no") (?t "do not cut tracebacks" "--full-trace") (?v "verbose" "--verbose") + (?w "very verbose" "-vv") (?x "exit after first failure" "--exitfirst")) :options '((?k "only names matching expression" "-k") From a7f80b2225c41461682fe5ed2ff74213c943a07c Mon Sep 17 00:00:00 2001 From: Ryan Pilgrim Date: Thu, 30 Jul 2020 10:22:32 -0400 Subject: [PATCH 02/11] attempt to add cycle behavior --- python-pytest.el | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/python-pytest.el b/python-pytest.el index 8aed112..39cbb6a 100644 --- a/python-pytest.el +++ b/python-pytest.el @@ -116,11 +116,15 @@ When non-nil only ‘test_foo()’ will match, and nothing else." (defvar-local python-pytest--current-command nil "Current command; used in python-pytest-mode buffers.") +(defvar-local python-pytest--verbosity-level 0 + "Verbosity level.") + (fmakunbound 'python-pytest-popup) (makunbound 'python-pytest-popup) ;;;###autoload (autoload 'python-pytest-popup "python-pytest" nil t) -(magit-define-popup python-pytest-popup +(magit + -define-popup python-pytest-popup "Show popup for running pytest." 'python-pytest :switches @@ -132,8 +136,7 @@ When non-nil only ‘test_foo()’ will match, and nothing else." (?q "quiet" "--quiet") (?s "do not capture output" "--capture=no") (?t "do not cut tracebacks" "--full-trace") - (?v "verbose" "--verbose") - (?w "very verbose" "-vv") + (?v "verbose" "--verbose" python-pytest--cycle-verbosity) (?x "exit after first failure" "--exitfirst")) :options '((?k "only names matching expression" "-k") @@ -562,6 +565,18 @@ Example: ‘MyABCThingy.__repr__’ becomes ‘test_my_abc_thingy_repr’." (t nil))) +(defun python-pytest--cycle-verbosity () + "Cycle the verbosity level from 0 (no -v flag) to 2 (-vv flag)." + (cond + ((memq python-pytest--verbosity '(0 1)) + (setq python-pytest--verbosity (+ 1 python-pytest--verbosity))) + (t (setq python-pytest--verbosity 0))) + (cond + ((= python-pytest--verbosity 0) "") + ((= python-pytest--verbosity 1) "-v") + ((= python-pytest--verbosity 2) "-vv"))) + + ;; third party integration (with-eval-after-load 'direnv From 5013c7c8889ba1e7fe4b0d6d7b15630a43a83df2 Mon Sep 17 00:00:00 2001 From: Ryan Pilgrim Date: Thu, 30 Jul 2020 10:32:02 -0400 Subject: [PATCH 03/11] fix typo --- python-pytest.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python-pytest.el b/python-pytest.el index 39cbb6a..6caaba5 100644 --- a/python-pytest.el +++ b/python-pytest.el @@ -123,8 +123,7 @@ When non-nil only ‘test_foo()’ will match, and nothing else." (makunbound 'python-pytest-popup) ;;;###autoload (autoload 'python-pytest-popup "python-pytest" nil t) -(magit - -define-popup python-pytest-popup +(magit-define-popup python-pytest-popup "Show popup for running pytest." 'python-pytest :switches From c5747a6cf6bef7dce2fcfe610c4616933cbd9b35 Mon Sep 17 00:00:00 2001 From: Ryan Pilgrim Date: Thu, 30 Jul 2020 10:37:56 -0400 Subject: [PATCH 04/11] move function to appropriate place in list --- python-pytest.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pytest.el b/python-pytest.el index 6caaba5..31916d4 100644 --- a/python-pytest.el +++ b/python-pytest.el @@ -135,7 +135,7 @@ When non-nil only ‘test_foo()’ will match, and nothing else." (?q "quiet" "--quiet") (?s "do not capture output" "--capture=no") (?t "do not cut tracebacks" "--full-trace") - (?v "verbose" "--verbose" python-pytest--cycle-verbosity) + (?v "verbose" python-pytest--cycle-verbosity) (?x "exit after first failure" "--exitfirst")) :options '((?k "only names matching expression" "-k") From 259ec1102dab0adbc066cc9f839693e5a45d73cc Mon Sep 17 00:00:00 2001 From: Ryan Pilgrim Date: Thu, 30 Jul 2020 10:42:02 -0400 Subject: [PATCH 05/11] try again --- python-pytest.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pytest.el b/python-pytest.el index 31916d4..5028302 100644 --- a/python-pytest.el +++ b/python-pytest.el @@ -135,7 +135,7 @@ When non-nil only ‘test_foo()’ will match, and nothing else." (?q "quiet" "--quiet") (?s "do not capture output" "--capture=no") (?t "do not cut tracebacks" "--full-trace") - (?v "verbose" python-pytest--cycle-verbosity) + (?v python-pytest--cycle-verbosity "verbose") (?x "exit after first failure" "--exitfirst")) :options '((?k "only names matching expression" "-k") From 33ccfca075fe7e4d1b2083b42053fde002c08b06 Mon Sep 17 00:00:00 2001 From: Ryan Pilgrim Date: Thu, 30 Jul 2020 10:47:37 -0400 Subject: [PATCH 06/11] back to last reasonable attempt (not working) --- python-pytest.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pytest.el b/python-pytest.el index 5028302..31916d4 100644 --- a/python-pytest.el +++ b/python-pytest.el @@ -135,7 +135,7 @@ When non-nil only ‘test_foo()’ will match, and nothing else." (?q "quiet" "--quiet") (?s "do not capture output" "--capture=no") (?t "do not cut tracebacks" "--full-trace") - (?v python-pytest--cycle-verbosity "verbose") + (?v "verbose" python-pytest--cycle-verbosity) (?x "exit after first failure" "--exitfirst")) :options '((?k "only names matching expression" "-k") From 6d6255a17521bf23139935cb615840c9fcd263b9 Mon Sep 17 00:00:00 2001 From: Ryan Pilgrim Date: Thu, 30 Jul 2020 11:28:19 -0400 Subject: [PATCH 07/11] Revert "back to last reasonable attempt (not working)" This reverts commit 33ccfca075fe7e4d1b2083b42053fde002c08b06. --- python-pytest.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pytest.el b/python-pytest.el index 31916d4..5028302 100644 --- a/python-pytest.el +++ b/python-pytest.el @@ -135,7 +135,7 @@ When non-nil only ‘test_foo()’ will match, and nothing else." (?q "quiet" "--quiet") (?s "do not capture output" "--capture=no") (?t "do not cut tracebacks" "--full-trace") - (?v "verbose" python-pytest--cycle-verbosity) + (?v python-pytest--cycle-verbosity "verbose") (?x "exit after first failure" "--exitfirst")) :options '((?k "only names matching expression" "-k") From 1babf954c86ee5ba3e2c1d0849b5ddbd444a90af Mon Sep 17 00:00:00 2001 From: Ryan Pilgrim Date: Thu, 30 Jul 2020 11:28:20 -0400 Subject: [PATCH 08/11] Revert "try again" This reverts commit 259ec1102dab0adbc066cc9f839693e5a45d73cc. --- python-pytest.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pytest.el b/python-pytest.el index 5028302..31916d4 100644 --- a/python-pytest.el +++ b/python-pytest.el @@ -135,7 +135,7 @@ When non-nil only ‘test_foo()’ will match, and nothing else." (?q "quiet" "--quiet") (?s "do not capture output" "--capture=no") (?t "do not cut tracebacks" "--full-trace") - (?v python-pytest--cycle-verbosity "verbose") + (?v "verbose" python-pytest--cycle-verbosity) (?x "exit after first failure" "--exitfirst")) :options '((?k "only names matching expression" "-k") From f664888de2a1de511da0b163aef8cbc920bca7cb Mon Sep 17 00:00:00 2001 From: Ryan Pilgrim Date: Thu, 30 Jul 2020 11:28:21 -0400 Subject: [PATCH 09/11] Revert "move function to appropriate place in list" This reverts commit c5747a6cf6bef7dce2fcfe610c4616933cbd9b35. --- python-pytest.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pytest.el b/python-pytest.el index 31916d4..6caaba5 100644 --- a/python-pytest.el +++ b/python-pytest.el @@ -135,7 +135,7 @@ When non-nil only ‘test_foo()’ will match, and nothing else." (?q "quiet" "--quiet") (?s "do not capture output" "--capture=no") (?t "do not cut tracebacks" "--full-trace") - (?v "verbose" python-pytest--cycle-verbosity) + (?v "verbose" "--verbose" python-pytest--cycle-verbosity) (?x "exit after first failure" "--exitfirst")) :options '((?k "only names matching expression" "-k") From ab39eae3f968cc432ef6981dfe6893a2c3dd1cc4 Mon Sep 17 00:00:00 2001 From: Ryan Pilgrim Date: Thu, 30 Jul 2020 11:28:21 -0400 Subject: [PATCH 10/11] Revert "fix typo" This reverts commit 5013c7c8889ba1e7fe4b0d6d7b15630a43a83df2. --- python-pytest.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python-pytest.el b/python-pytest.el index 6caaba5..39cbb6a 100644 --- a/python-pytest.el +++ b/python-pytest.el @@ -123,7 +123,8 @@ When non-nil only ‘test_foo()’ will match, and nothing else." (makunbound 'python-pytest-popup) ;;;###autoload (autoload 'python-pytest-popup "python-pytest" nil t) -(magit-define-popup python-pytest-popup +(magit + -define-popup python-pytest-popup "Show popup for running pytest." 'python-pytest :switches From 71ec9a490a22823a28a2a14150e9712440d7b23c Mon Sep 17 00:00:00 2001 From: Ryan Pilgrim Date: Thu, 30 Jul 2020 11:28:22 -0400 Subject: [PATCH 11/11] Revert "attempt to add cycle behavior" This reverts commit a7f80b2225c41461682fe5ed2ff74213c943a07c. --- python-pytest.el | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/python-pytest.el b/python-pytest.el index 39cbb6a..8aed112 100644 --- a/python-pytest.el +++ b/python-pytest.el @@ -116,15 +116,11 @@ When non-nil only ‘test_foo()’ will match, and nothing else." (defvar-local python-pytest--current-command nil "Current command; used in python-pytest-mode buffers.") -(defvar-local python-pytest--verbosity-level 0 - "Verbosity level.") - (fmakunbound 'python-pytest-popup) (makunbound 'python-pytest-popup) ;;;###autoload (autoload 'python-pytest-popup "python-pytest" nil t) -(magit - -define-popup python-pytest-popup +(magit-define-popup python-pytest-popup "Show popup for running pytest." 'python-pytest :switches @@ -136,7 +132,8 @@ When non-nil only ‘test_foo()’ will match, and nothing else." (?q "quiet" "--quiet") (?s "do not capture output" "--capture=no") (?t "do not cut tracebacks" "--full-trace") - (?v "verbose" "--verbose" python-pytest--cycle-verbosity) + (?v "verbose" "--verbose") + (?w "very verbose" "-vv") (?x "exit after first failure" "--exitfirst")) :options '((?k "only names matching expression" "-k") @@ -565,18 +562,6 @@ Example: ‘MyABCThingy.__repr__’ becomes ‘test_my_abc_thingy_repr’." (t nil))) -(defun python-pytest--cycle-verbosity () - "Cycle the verbosity level from 0 (no -v flag) to 2 (-vv flag)." - (cond - ((memq python-pytest--verbosity '(0 1)) - (setq python-pytest--verbosity (+ 1 python-pytest--verbosity))) - (t (setq python-pytest--verbosity 0))) - (cond - ((= python-pytest--verbosity 0) "") - ((= python-pytest--verbosity 1) "-v") - ((= python-pytest--verbosity 2) "-vv"))) - - ;; third party integration (with-eval-after-load 'direnv