File tree Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 1
1
# See https://pre-commit.com for more information
2
2
# See https://pre-commit.com/hooks.html for more hooks
3
- exclude : /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)
4
3
repos :
5
4
- repo : https://github.com/pre-commit/pre-commit-hooks
6
5
rev : v3.2.0
7
6
hooks :
8
7
- id : trailing-whitespace
8
+ exclude : /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)
9
9
- id : end-of-file-fixer
10
+ exclude : /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)
10
11
11
12
- repo : https://github.com/pre-commit/mirrors-clang-format
12
13
rev : v13.0.1
24
25
25
26
- id : sync-files
26
27
name : Fix files required to be identical
28
+ files : \.(qll?|qhelp)$
27
29
language : system
28
30
entry : python3 config/sync-files.py --latest
29
31
pass_filenames : false
43
45
44
46
- id : swift-codegen-unit-tests
45
47
name : Run Swift code generation unit tests
46
- files : ^swift/codegen
48
+ files : ^swift/codegen/.*\.py$
47
49
language : system
48
50
entry : bazel test //swift/codegen:tests
49
51
pass_filenames : false
Original file line number Diff line number Diff line change 1
1
import subprocess
2
2
import sys
3
3
4
- import mock
5
-
6
4
from swift .codegen import qlgen
7
5
from swift .codegen .lib import ql , paths
8
6
from swift .codegen .test .utils import *
Original file line number Diff line number Diff line change 1
- import io
2
- import pathlib
3
1
import sys
4
2
5
- import mock
6
- import pytest
7
-
8
- import swift .codegen .lib .schema as schema
9
3
from swift .codegen .test .utils import *
10
4
11
5
root_name = schema .root_class_name
12
6
7
+
13
8
@pytest .fixture
14
9
def load (tmp_path ):
15
10
file = tmp_path / "schema.yml"
11
+
16
12
def ret (yml ):
17
13
write (file , yml )
18
14
return schema .load (file )
19
15
20
16
return ret
21
17
18
+
22
19
def test_empty_schema (load ):
23
20
ret = load ("{}" )
24
21
assert ret .classes == [schema .Class (root_name )]
You can’t perform that action at this time.
0 commit comments