-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
schema.json
177 lines (177 loc) · 4.78 KB
/
schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://raw.githubusercontent.com/typeddjango/pytest-mypy-plugins/master/pytest_mypy_plugins/schema.json",
"title": "pytest-mypy-plugins test file",
"description": "JSON Schema for a pytest-mypy-plugins test file",
"type": "array",
"items": {
"type": "object",
"additionalProperties": true,
"properties": {
"case": {
"type": "string",
"pattern": "^[a-zA-Z0-9_]+$",
"description": "Name of the test case, MUST comply to the `^[a-zA-Z0-9_]+$` pattern.",
"examples": [
{
"case": "TestCase1"
},
{
"case": "999"
},
{
"case": "test_case_1"
}
]
},
"main": {
"type": "string",
"description": "Portion of the code as if written in `.py` file. Must be valid Python code.",
"examples": [
{
"main": "reveal_type(1)"
}
]
},
"out": {
"type": "string",
"description": "Verbose output expected from `mypy`.",
"examples": [
{
"out": "main:1: note: Revealed type is \"Literal[1]?\""
}
]
},
"files": {
"type": "array",
"items": {
"$ref": "#/definitions/File"
},
"description": "List of extra files to simulate imports if needed.",
"examples": [
[
{
"path": "myapp/__init__.py"
},
{
"path": "myapp/utils.py",
"content": "def help(): pass"
}
]
]
},
"disable_cache": {
"type": "boolean",
"description": "Set to `true` disables `mypy` caching.",
"default": false
},
"mypy_config": {
"type": "string",
"description": "Inline `mypy` configuration, passed directly to `mypy`.",
"examples": [
{
"mypy_config": "force_uppercase_builtins = true\nforce_union_syntax = true\n"
}
]
},
"env": {
"type": "array",
"items": {
"type": "string"
},
"description": "Environmental variables to be provided inside of test run.",
"examples": [
"MYPYPATH=../extras",
"DJANGO_SETTINGS_MODULE=mysettings"
]
},
"parametrized": {
"type": "array",
"items": {
"$ref": "#/definitions/Parameter"
},
"description": "List of parameters, similar to [`@pytest.mark.parametrize`](https://docs.pytest.org/en/stable/parametrize.html). Each entry **must** have the **exact** same set of keys.",
"examples": [
[
{
"val": 1,
"rt": "int"
},
{
"val": "1",
"rt": "str"
}
]
]
},
"skip": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "string"
}
],
"description": "An expression set in `skip` is passed directly into [`eval`](https://docs.python.org/3/library/functions.html#eval). It is advised to take a peek and learn about how `eval` works. Expression evaluated with following globals set: `sys`, `os`, `pytest` and `platform`.",
"examples": [
"yes",
true,
"sys.version_info > (2, 0)"
],
"default": false
},
"expect_fail": {
"type": "boolean",
"description": "Mark test case as an expected failure.",
"default": false
},
"regex": {
"type": "boolean",
"description": "Allow regular expressions in comments to be matched against actual output. _See pytest_mypy_plugins/tests/test-regex_assertions.yml for examples_",
"default": false
}
},
"required": [
"case",
"main"
]
},
"definitions": {
"File": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "File path.",
"examples": [
"../extras/extra_module.py",
"myapp/__init__.py"
]
},
"content": {
"type": "string",
"description": "File content. Can be empty. Must be valid Python code.",
"examples": [
"def help(): pass",
"def help():\n pass\n"
]
}
},
"required": [
"path"
]
},
"Parameter": {
"type": "object",
"additionalProperties": true,
"description": "A mapping of keys to values, similar to Python's `Mapping[str, Any]`.",
"examples": [
{
"val": "1",
"rt": "str"
}
]
}
}
}