diff options
| author | Augusto Stoffel | 2022-08-13 17:39:57 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2022-08-19 14:59:27 +0200 |
| commit | 275cef9e06b406c6e68ec5cf9fe882ab0fde8999 (patch) | |
| tree | fce3e37a12e2f4874c156acc77c5c2fdfc13548b /test/lisp/progmodes/python-tests.el | |
| parent | ec347aec0fc7d2d3e6603b6694d9978cb9fcb9e9 (diff) | |
| download | emacs-275cef9e06b406c6e68ec5cf9fe882ab0fde8999.tar.gz emacs-275cef9e06b406c6e68ec5cf9fe882ab0fde8999.zip | |
python.el: Adjustments to Flymake backend
* lisp/progmodes/python (python-flymake-command): Advertise possiblity
to use pylint.
(python-flymake-command-output-pattern): Make compatible with recent
versions of pyflakes. (Bug#53913)
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
| -rw-r--r-- | test/lisp/progmodes/python-tests.el | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 0904dfc9639..a11716a7b53 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el | |||
| @@ -6300,6 +6300,40 @@ buffer with overlapping strings." | |||
| 6300 | a = 1 | 6300 | a = 1 |
| 6301 | "))) | 6301 | "))) |
| 6302 | 6302 | ||
| 6303 | |||
| 6304 | ;;; Flymake | ||
| 6305 | |||
| 6306 | (ert-deftest python-tests--flymake-command-output-pattern () | ||
| 6307 | (pcase-let ((`(,patt ,line ,col ,type ,msg) | ||
| 6308 | python-flymake-command-output-pattern)) | ||
| 6309 | ;; Pyflakes output as of version 2.4.0 | ||
| 6310 | (let ((output "<stdin>:12:34 'a.b.c as d' imported but unused")) | ||
| 6311 | (string-match patt output) | ||
| 6312 | (should (equal (match-string line output) "12")) | ||
| 6313 | (when col (should (equal (match-string col output) "34"))) | ||
| 6314 | (should (equal (match-string msg output) | ||
| 6315 | "'a.b.c as d' imported but unused"))) | ||
| 6316 | ;; Flake8 output as of version 4.0.1 | ||
| 6317 | (let ((output "stdin:12:34: F401 'a.b.c as d' imported but unused")) | ||
| 6318 | (string-match patt output) | ||
| 6319 | (should (equal (match-string line output) "12")) | ||
| 6320 | (when col (should (equal (match-string col output) "34"))) | ||
| 6321 | (when type (should (equal (match-string type output) "F401"))) | ||
| 6322 | (should (equal (match-string msg output) | ||
| 6323 | (if type | ||
| 6324 | "'a.b.c as d' imported but unused" | ||
| 6325 | "F401 'a.b.c as d' imported but unused")))) | ||
| 6326 | ;; Pylint output as of version 2.14.5 | ||
| 6327 | (let ((output "stdin:12:34: W0611: Unused import a.b.c (unused-import)")) | ||
| 6328 | (string-match patt output) | ||
| 6329 | (should (equal (match-string line output) "12")) | ||
| 6330 | (when col (should (equal (match-string col output) "34"))) | ||
| 6331 | (when type (should (equal (match-string type output) "W0611"))) | ||
| 6332 | (should (equal (match-string msg output) | ||
| 6333 | (if type | ||
| 6334 | "Unused import a.b.c (unused-import)" | ||
| 6335 | "W0611: Unused import a.b.c (unused-import)")))))) | ||
| 6336 | |||
| 6303 | (provide 'python-tests) | 6337 | (provide 'python-tests) |
| 6304 | 6338 | ||
| 6305 | ;;; python-tests.el ends here | 6339 | ;;; python-tests.el ends here |