Skip to content

Commit 7f04760

Browse files
committed
Swift: removed spurious mock import
1 parent 68231bf commit 7f04760

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
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)
43
repos:
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
@@ -24,6 +25,7 @@ repos:
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
@@ -43,7 +45,7 @@ repos:
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

swift/codegen/test/test_qlgen.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import subprocess
22
import sys
33

4-
import mock
5-
64
from swift.codegen import qlgen
75
from swift.codegen.lib import ql, paths
86
from swift.codegen.test.utils import *

swift/codegen/test/test_schema.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
1-
import io
2-
import pathlib
31
import sys
42

5-
import mock
6-
import pytest
7-
8-
import swift.codegen.lib.schema as schema
93
from swift.codegen.test.utils import *
104

115
root_name = schema.root_class_name
126

7+
138
@pytest.fixture
149
def 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+
2219
def test_empty_schema(load):
2320
ret = load("{}")
2421
assert ret.classes == [schema.Class(root_name)]

0 commit comments

Comments
 (0)