@@ -116,11 +116,15 @@ When non-nil only ‘test_foo()’ will match, and nothing else."
116
116
(defvar-local python-pytest--current-command nil
117
117
" Current command; used in python-pytest-mode buffers." )
118
118
119
+ (defvar-local python-pytest--verbosity-level 0
120
+ " Verbosity level." )
121
+
119
122
(fmakunbound 'python-pytest-popup )
120
123
(makunbound 'python-pytest-popup )
121
124
122
125
;;;### autoload (autoload 'python-pytest-popup "python-pytest" nil t)
123
- (magit-define-popup python-pytest-popup
126
+ (magit
127
+ -define-popup python-pytest-popup
124
128
" Show popup for running pytest."
125
129
'python-pytest
126
130
:switches
@@ -132,8 +136,7 @@ When non-nil only ‘test_foo()’ will match, and nothing else."
132
136
(?q " quiet" " --quiet" )
133
137
(?s " do not capture output" " --capture=no" )
134
138
(?t " do not cut tracebacks" " --full-trace" )
135
- (?v " verbose" " --verbose" )
136
- (?w " very verbose" " -vv" )
139
+ (?v " verbose" " --verbose" python-pytest--cycle-verbosity)
137
140
(?x " exit after first failure" " --exitfirst" ))
138
141
:options
139
142
'((?k " only names matching expression" " -k" )
@@ -562,6 +565,18 @@ Example: ‘MyABCThingy.__repr__’ becomes ‘test_my_abc_thingy_repr’."
562
565
(t nil )))
563
566
564
567
568
+ (defun python-pytest--cycle-verbosity ()
569
+ " Cycle the verbosity level from 0 (no -v flag) to 2 (-vv flag)."
570
+ (cond
571
+ ((memq python-pytest--verbosity '(0 1 ))
572
+ (setq python-pytest--verbosity (+ 1 python-pytest--verbosity)))
573
+ (t (setq python-pytest--verbosity 0 )))
574
+ (cond
575
+ ((= python-pytest--verbosity 0 ) " " )
576
+ ((= python-pytest--verbosity 1 ) " -v" )
577
+ ((= python-pytest--verbosity 2 ) " -vv" )))
578
+
579
+
565
580
; ; third party integration
566
581
567
582
(with-eval-after-load 'direnv
0 commit comments