Skip to content

Commit d80b521

Browse files
committed
highlighting pytest results
1 parent 3e5a013 commit d80b521

3 files changed

Lines changed: 189 additions & 0 deletions

File tree

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,29 @@
5151
],
5252
"main": "./out/client/extension",
5353
"contributes": {
54+
"languages": [
55+
{
56+
"id": "testOutput",
57+
"aliases": [
58+
"vscode-output-colorizer",
59+
"testOutput"
60+
],
61+
"extensions": [
62+
".log"
63+
],
64+
"configuration": "./src/syntaxes/test.configuration.json",
65+
"mimetypes": [
66+
"text/x-code-output"
67+
]
68+
}
69+
],
70+
"grammars": [
71+
{
72+
"language": "testOutput",
73+
"scopeName": "testOutput.log",
74+
"path": "./src/syntaxes/test.tmLanguage"
75+
}
76+
],
5477
"snippets": [
5578
{
5679
"language": "python",
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"comments": {},
3+
// symbols used as brackets
4+
"brackets": [
5+
[
6+
"{",
7+
"}"
8+
],
9+
[
10+
"[",
11+
"]"
12+
],
13+
[
14+
"(",
15+
")"
16+
]
17+
],
18+
// symbols that are auto closed when typing
19+
"autoClosingPairs": [
20+
[
21+
"{",
22+
"}"
23+
],
24+
[
25+
"[",
26+
"]"
27+
],
28+
[
29+
"(",
30+
")"
31+
],
32+
[
33+
"\"",
34+
"\""
35+
],
36+
[
37+
"'",
38+
"'"
39+
]
40+
],
41+
// symbols that that can be used to surround a selection
42+
"surroundingPairs": [
43+
[
44+
"{",
45+
"}"
46+
],
47+
[
48+
"[",
49+
"]"
50+
],
51+
[
52+
"(",
53+
")"
54+
],
55+
[
56+
"\"",
57+
"\""
58+
],
59+
[
60+
"'",
61+
"'"
62+
]
63+
]
64+
}

src/syntaxes/test.tmLanguage

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>scopeName</key>
6+
<string>testOutput.log</string>
7+
<key>fileTypes</key>
8+
<array>
9+
<string>log</string>
10+
</array>
11+
<key>name</key>
12+
<string>Log file</string>
13+
<key>patterns</key>
14+
<array>
15+
<!-- py.test file summary -->
16+
<!--
17+
tests/test_another.py ..
18+
tests/test_multi.py ....F.....F
19+
tests/test_one.py F.
20+
tests/test_three.py ...F
21+
-->
22+
<dict>
23+
<key>match</key>
24+
<string>.*\.py \.*F(F|\.){0,}$</string>
25+
<key>name</key>
26+
<string>error-token</string>
27+
</dict>
28+
<dict>
29+
<key>match</key>
30+
<string>.*\.py (s|F|\.){0,}s(s|F|\.){0,}$</string>
31+
<key>name</key>
32+
<string>warn-token</string>
33+
</dict>
34+
<!-- py.test errors -->
35+
<!--
36+
> assert False
37+
E assert False
38+
-->
39+
<dict>
40+
<key>match</key>
41+
<string>^E .*</string>
42+
<key>name</key>
43+
<string>error-token</string>
44+
</dict>
45+
<!-- py.test errors -->
46+
<!--
47+
_________ Test_CheckMyApp.Test_NestedClassA.test_nested_class_methodC __________
48+
49+
self = <test_multi.Test_NestedClassA instance at 0x107deabd8>
50+
51+
def test_nested_class_methodC(self):
52+
> assert False
53+
E assert False
54+
55+
tests/test_multi.py:19: AssertionError
56+
-->
57+
<dict>
58+
<key>match</key>
59+
<string>.*\.py:[0-9]+: ([a-z]|[A-Z])*Error$</string>
60+
<key>name</key>
61+
<string>error-token</string>
62+
</dict>
63+
<!-- py.test errors -->
64+
<dict>
65+
<key>match</key>
66+
<string> ([a-z]|[A-Z])*Error:</string>
67+
<key>name</key>
68+
<string>error-token</string>
69+
</dict>
70+
<!-- py.test summary -->
71+
<!--
72+
================ 8 failed, 28 passed, 2 skipped in 0.11 seconds ================
73+
-->
74+
<dict>
75+
<key>match</key>
76+
<string>^=+.* failed.*=$</string>
77+
<key>name</key>
78+
<string>error-token</string>
79+
</dict>
80+
<dict>
81+
<key>match</key>
82+
<string>^=+.* skipped.*=$</string>
83+
<key>name</key>
84+
<string>warn-token</string>
85+
</dict>
86+
<dict>
87+
<key>match</key>
88+
<string>^=+.* passed.*=$</string>
89+
<key>name</key>
90+
<string>comment.line</string>
91+
</dict>
92+
<dict>
93+
<key>match</key>
94+
<string>collected [0-9]+ items</string>
95+
<key>name</key>
96+
<string>info-token</string>
97+
</dict>
98+
</array>
99+
<key>uuid</key>
100+
<string>ab259404-3072-4cd4-a943-7cbbd32e373f</string>
101+
</dict>
102+
</plist>

0 commit comments

Comments
 (0)