Skip to content

Commit ecfac02

Browse files
committed
Prefix our test names
This doesn't matter when running on Travis CI, but it's much more convenient when running tests in a live Emacs instance.
1 parent ac6696d commit ecfac02

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

test/pyimport-test.el

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,61 +2,61 @@
22
(require 'pyimport)
33
(require 'shut-up)
44

5-
(ert-deftest var-extraction ()
5+
(ert-deftest pyimport-var-extraction ()
66
"Ensure we parse pyflakes output for older pyflakes versions."
77
(should
88
(equal
99
(pyimport--extract-unused-var "'foo' imported but unused")
1010
"foo")))
1111

12-
(ert-deftest var-extraction-new ()
12+
(ert-deftest pyimport-var-extraction-new ()
1313
"Ensure we parse pyflakes output for recent pyflakes versions."
1414
(should
1515
(equal
1616
(pyimport--extract-unused-var "'foo.bar' imported but unused")
1717
"bar")))
1818

19-
(ert-deftest remove-import-case-sensitive ()
19+
(ert-deftest pyimport-remove-import-case-sensitive ()
2020
"Ensure we remove imports case-sensitively"
2121
(with-temp-buffer
2222
(insert "import cPickle as pickle")
2323
(pyimport--remove-import 1 "pickle")
2424
(should
2525
(equal (buffer-string) ""))))
2626

27-
(ert-deftest remove-import-extra-whitespace ()
27+
(ert-deftest pyimport-remove-import-extra-whitespace ()
2828
"Ensure we remove imports correctly even when there's extra whitespace."
2929
(with-temp-buffer
3030
(insert "from foo import bar")
3131
(pyimport--remove-import 1 "bar")
3232
(should
3333
(equal (buffer-string) ""))))
3434

35-
(ert-deftest remove-import-as ()
35+
(ert-deftest pyimport-remove-import-as ()
3636
"Ensure we remove imports correctly when there are aliases."
3737
(with-temp-buffer
3838
(insert "from foo import bar as newname")
3939
(pyimport--remove-import 1 "newname")
4040
(should
4141
(equal (buffer-string) ""))))
4242

43-
(ert-deftest remove-import-as-alias ()
43+
(ert-deftest pyimport-remove-import-as-alias ()
4444
"Ensure we remove imports correctly when there are aliases."
4545
(with-temp-buffer
4646
(insert "import foo.bar as bar")
4747
(pyimport--remove-import 1 "bar")
4848
(should
4949
(equal (buffer-string) ""))))
5050

51-
(ert-deftest remove-on-line-first ()
51+
(ert-deftest pyimport-remove-on-line-first ()
5252
"We should remove the first occurrence, if present."
5353
(with-temp-buffer
5454
(insert "foo bar baz bar")
5555
(pyimport--remove-on-line "bar")
5656
(should
5757
(equal (buffer-string) "foo baz bar"))))
5858

59-
(ert-deftest import-lines ()
59+
(ert-deftest pyimport-import-lines ()
6060
(with-temp-buffer
6161
(insert "from foo import bar\n"
6262
"import baz\n"
@@ -68,7 +68,7 @@
6868
"import baz"
6969
"import quz.zox")))))
7070

71-
(ert-deftest import-lines-correct-buffer ()
71+
(ert-deftest pyimport-import-lines-correct-buffer ()
7272
"Ensure we extract lines from the buffer passed in."
7373
(let ((buf (get-buffer-create "my-buffer")))
7474
(with-current-buffer buf
@@ -81,7 +81,7 @@
8181
(should (equal (get-text-property 0 'pyimport-path (-first-item lines))
8282
"my-buffer")))))))
8383

84-
(ert-deftest extract-unused-var ()
84+
(ert-deftest pyimport-extract-unused-var ()
8585
(should
8686
(equal
8787
(pyimport--extract-unused-var "'foo' imported but unused")
@@ -95,7 +95,7 @@
9595
(pyimport--extract-unused-var "'foo.bar as xxx' imported but unused")
9696
"xxx")))
9797

98-
(ert-deftest same-module ()
98+
(ert-deftest pyimport-same-module ()
9999
(should
100100
(pyimport--same-module
101101
"from foo import x"
@@ -105,7 +105,7 @@
105105
"from foo import x"
106106
"from foo.bar import x"))))
107107

108-
(ert-deftest buffers-in-mode ()
108+
(ert-deftest pyimport-buffers-in-mode ()
109109
(let ((buf1 (get-buffer-create "buf1"))
110110
(buf2 (get-buffer-create "buf2")))
111111
(shut-up
@@ -123,7 +123,7 @@
123123
(kill-buffer buf1)
124124
(kill-buffer buf2)))
125125

126-
(ert-deftest for-each-line ()
126+
(ert-deftest pyimport-for-each-line ()
127127
(let (result-lines)
128128
(with-temp-buffer
129129
(insert "a\nb\nc\nd")
@@ -134,15 +134,15 @@
134134
(should
135135
(equal result-lines '("a" "b" "c" "d")))))
136136

137-
(ert-deftest insert-import-simple ()
137+
(ert-deftest pyimport-insert-import-simple ()
138138
"Test inserting an import."
139139
(with-temp-buffer
140140
(pyimport--insert-import "from foo import x")
141141
(should
142142
(equal (buffer-string)
143143
"from foo import x\n"))))
144144

145-
(ert-deftest insert-import-with-existing ()
145+
(ert-deftest pyimport-insert-import-with-existing ()
146146
"Test inserting an import when we already have imports from that module."
147147
(with-temp-buffer
148148
(insert "from foo import x\n")
@@ -151,7 +151,7 @@
151151
(equal (buffer-string)
152152
"from foo import x, y\n"))))
153153

154-
(ert-deftest insert-import-duplicate ()
154+
(ert-deftest pyimport-insert-import-duplicate ()
155155
"Test inserting an import when we already have that symbol imported"
156156
(with-temp-buffer
157157
(insert "from foo import x\n")
@@ -160,7 +160,7 @@
160160
(equal (buffer-string)
161161
"from foo import x\n"))))
162162

163-
(ert-deftest extract-simple-import ()
163+
(ert-deftest pyimport-extract-simple-import ()
164164
(should
165165
(equal
166166
(pyimport--extract-simple-import "from foo import bar, xxx" "bar")

0 commit comments

Comments
 (0)