File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,8 @@ FLYCHECK-MESSAGE should take the form \"'foo' imported but unused\"."
150
150
(s-match " '\\ (.*\\ )' imported but unused" )
151
151
-last-item
152
152
(s-split (rx " ." ))
153
+ -last-item
154
+ (s-split (rx " as " ))
153
155
-last-item))
154
156
155
157
(defun pyimport--remove-on-line (text )
Original file line number Diff line number Diff line change 57
57
(should (equal (get-text-property 0 'pyimport-path (-first-item lines))
58
58
" my-buffer" )))))))
59
59
60
+ (ert-deftest extract-unused-var ()
61
+ (should
62
+ (equal
63
+ (pyimport--extract-unused-var " 'foo' imported but unused" )
64
+ " foo" ))
65
+ (should
66
+ (equal
67
+ (pyimport--extract-unused-var " 'foo.bar' imported but unused" )
68
+ " bar" ))
69
+ (should
70
+ (equal
71
+ (pyimport--extract-unused-var " 'foo.bar as xxx' imported but unused" )
72
+ " xxx" )))
73
+
60
74
(ert-deftest same-module ()
61
75
(should
62
76
(pyimport--same-module
You can’t perform that action at this time.
0 commit comments