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 11# See https://pre-commit.com for more information
22# See https://pre-commit.com/hooks.html for more hooks
3- exclude : /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)
43repos :
54 - repo : https://github.com/pre-commit/pre-commit-hooks
65 rev : v3.2.0
76 hooks :
87 - id : trailing-whitespace
8+ exclude : /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)
99 - id : end-of-file-fixer
10+ exclude : /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)
1011
1112 - repo : https://github.com/pre-commit/mirrors-clang-format
1213 rev : v13.0.1
2425
2526 - id : sync-files
2627 name : Fix files required to be identical
28+ files : \.(qll?|qhelp)$
2729 language : system
2830 entry : python3 config/sync-files.py --latest
2931 pass_filenames : false
4345
4446 - id : swift-codegen-unit-tests
4547 name : Run Swift code generation unit tests
46- files : ^swift/codegen
48+ files : ^swift/codegen/.*\.py$
4749 language : system
4850 entry : bazel test //swift/codegen:tests
4951 pass_filenames : false
Original file line number Diff line number Diff line change 11import subprocess
22import sys
33
4- import mock
5-
64from swift .codegen import qlgen
75from swift .codegen .lib import ql , paths
86from swift .codegen .test .utils import *
Original file line number Diff line number Diff line change 1- import io
2- import pathlib
31import sys
42
5- import mock
6- import pytest
7-
8- import swift .codegen .lib .schema as schema
93from swift .codegen .test .utils import *
104
115root_name = schema .root_class_name
126
7+
138@pytest .fixture
149def load (tmp_path ):
1510 file = tmp_path / "schema.yml"
11+
1612 def ret (yml ):
1713 write (file , yml )
1814 return schema .load (file )
1915
2016 return ret
2117
18+
2219def test_empty_schema (load ):
2320 ret = load ("{}" )
2421 assert ret .classes == [schema .Class (root_name )]
You can’t perform that action at this time.
0 commit comments