[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 4e85910 088/215: Add pytest error message pattern in pytho
From: |
Rocky Bernstein |
Subject: |
[elpa] master 4e85910 088/215: Add pytest error message pattern in python debuggers |
Date: |
Sat, 30 Jul 2016 14:48:56 +0000 (UTC) |
branch: master
commit 4e85910b106e3094d2b27ac34f584df5bf4ab457
Author: rocky <address@hidden>
Commit: rocky <address@hidden>
Add pytest error message pattern in python debuggers
---
realgud/debugger/pdb/init.el | 4 ++++
realgud/debugger/trepan2/init.el | 4 ++++
realgud/debugger/trepan3k/init.el | 4 ++++
realgud/lang/python.el | 18 ++++++++++++++++++
4 files changed, 30 insertions(+)
diff --git a/realgud/debugger/pdb/init.el b/realgud/debugger/pdb/init.el
index dfcb765..4ad8230 100644
--- a/realgud/debugger/pdb/init.el
+++ b/realgud/debugger/pdb/init.el
@@ -57,6 +57,10 @@ realgud-loc-pat struct")
(setf (gethash "lang-backtrace" realgud:pdb-pat-hash)
realgud-python-backtrace-loc-pat)
+;; Regular expression that describes location in a pytest error
+(setf (gethash "pytest-error" realgud:pdb-pat-hash)
+ realgud-pytest-error-loc-pat)
+
;; Regular expression that describes a "breakpoint set" line. For example:
;; Breakpoint 1 at /usr/bin/pdb:7
(setf (gethash "brkpt-set" realgud:pdb-pat-hash)
diff --git a/realgud/debugger/trepan2/init.el b/realgud/debugger/trepan2/init.el
index 24f239d..9fb9fec 100644
--- a/realgud/debugger/trepan2/init.el
+++ b/realgud/debugger/trepan2/init.el
@@ -53,6 +53,10 @@ realgud-loc-pat struct")
(setf (gethash "lang-backtrace" realgud:trepan2-pat-hash)
realgud-python-backtrace-loc-pat)
+;; Regular expression that describes location in a pytest error
+(setf (gethash "pytest-error" realgud:trepan2-pat-hash)
+ realgud-pytest-error-loc-pat)
+
;; Regular expression that describes a "breakpoint set" line
(setf (gethash "brkpt-set" realgud:trepan2-pat-hash)
realgud:python-trepan-brkpt-set-pat)
diff --git a/realgud/debugger/trepan3k/init.el
b/realgud/debugger/trepan3k/init.el
index d555ed9..b9d8f2a 100644
--- a/realgud/debugger/trepan3k/init.el
+++ b/realgud/debugger/trepan3k/init.el
@@ -51,6 +51,10 @@ realgud-loc-pat struct")
(setf (gethash "lang-backtrace" realgud:trepan3k-pat-hash)
realgud-python-backtrace-loc-pat)
+;; Regular expression that describes location in a pytest error
+(setf (gethash "pytest-error" realgud:trepan3k-pat-hash)
+ realgud-pytest-error-loc-pat)
+
;; Regular expression that describes a "breakpoint set" line
(setf (gethash "brkpt-set" realgud:trepan3k-pat-hash)
realgud:python-trepan-brkpt-set-pat)
diff --git a/realgud/lang/python.el b/realgud/lang/python.el
index 21190c7..e3ae1cf 100644
--- a/realgud/lang/python.el
+++ b/realgud/lang/python.el
@@ -6,6 +6,8 @@
(require-relative-list '("../common/regexp" "../common/loc" "../common/track")
"realgud-")
+(declare-function realgud-goto-line-for-pt 'realgud-track)
+
(defconst realgud-python-backtrace-loc-pat
(make-realgud-loc-pat
:regexp "^[ \t]+File \"\\(.+\\)\", line \\([0-9]+\\)"
@@ -25,6 +27,7 @@ traceback) line." )
\\{realgud-example-map-standard}"
(define-key map (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line)
(define-key map (kbd "C-c !!") 'realgud:goto-lang-backtrace-line)
+ (define-key map (kbd "C-c !e") 'realgud:pytest-goto-errmsg-line)
)
@@ -121,6 +124,21 @@ traceback) line." )
;; (0 trepan2-frames-current-frame-face append))
))
+(defconst realgud-pytest-error-loc-pat
+ (make-realgud-loc-pat
+ :regexp "^\\(.*\\):\\([0-9]+\\): in "
+ :file-group 1
+ :line-group 2)
+ "A realgud-loc-pat struct that describes a Pytest error line"
+ )
+
+
+;; FIXME: there is probably a less redundant way to do the following
+;; FNS.
+(defun realgud:pytest-goto-errmsg-line (pt)
+ "Display the location mentioned by the pytest error at PT."
+ (interactive "d")
+ (realgud-goto-line-for-pt pt "pytest-error"))
(provide-me "realgud-lang-")
- [elpa] master 1716c8a 109/215: Towards fixing up tab completion in ipdb., (continued)
- [elpa] master 1716c8a 109/215: Towards fixing up tab completion in ipdb., Rocky Bernstein, 2016/07/30
- [elpa] master e04eeb2 117/215: Improve eval: run on region if active, and fall back to prompting, Rocky Bernstein, 2016/07/30
- [elpa] master fd00428 118/215: Merge pull request #86 from cpitclaudel/83-improve-e-binding, Rocky Bernstein, 2016/07/30
- [elpa] master b275bd2 119/215: Improve behavior of delete, enable, and disable, Rocky Bernstein, 2016/07/30
- [elpa] master ca33520 120/215: Add a prefix arg to "continue" command, Rocky Bernstein, 2016/07/30
- [elpa] master 379528b 106/215: Disable ipdb until melpa is updated, Rocky Bernstein, 2016/07/30
- [elpa] master e049c12 124/215: Merge pull request #89 from cpitclaudel/87-improve-delete-command, Rocky Bernstein, 2016/07/30
- [elpa] master 91704f9 141/215: Automatically attach to a command buffer when enabling short-key-mode, Rocky Bernstein, 2016/07/30
- [elpa] master 40e73bc 123/215: Merge pull request #92 from cpitclaudel/82-add-safe-mode, Rocky Bernstein, 2016/07/30
- [elpa] master f3426ed 072/215: Merge branch 'master' of github.com:rocky/emacs-dbgr, Rocky Bernstein, 2016/07/30
- [elpa] master 4e85910 088/215: Add pytest error message pattern in python debuggers,
Rocky Bernstein <=
- [elpa] master 01617c5 100/215: ipdb: add regex test, Rocky Bernstein, 2016/07/30
- [elpa] master 5395757 091/215: More cleanup from last two commits., Rocky Bernstein, 2016/07/30
- [elpa] master 1e2fe55 098/215: Add rspec loc pattern.., Rocky Bernstein, 2016/07/30
- [elpa] master ea5dcba 094/215: ipdb: add new debugger based on pdb, Rocky Bernstein, 2016/07/30
- [elpa] master d1c1176 146/215: Simplify the implementation of realgud:cmdbuf-associate, Rocky Bernstein, 2016/07/30
- [elpa] master 95f076e 150/215: Improve IPDB completion, Rocky Bernstein, 2016/07/30
- [elpa] master d45788c 152/215: Merge pull request #106 from rocky/75-ipdb-completion, Rocky Bernstein, 2016/07/30
- [elpa] master 032ea4b 143/215: Merge branch 'master' of github.com:rocky/emacs-dbgr, Rocky Bernstein, 2016/07/30
- [elpa] master 549f6f0 135/215: Merge pull request #98 from rocky/83-better-scope-keybindings, Rocky Bernstein, 2016/07/30
- [elpa] master aedea61 138/215: Merge pull request #101 from rocky/bp-icon-in-fringe, Rocky Bernstein, 2016/07/30