Skip to content

Commit ad302e7

Browse files
committed
Add a permanent way to drop into a debugger from the suite.
1 parent f44effc commit ad302e7

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
exclude: json/
22

33
repos:
4-
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
55
rev: v4.3.0
66
hooks:
7-
- id: check-ast
8-
- id: check-docstring-first
9-
- id: check-json
10-
- id: check-toml
11-
- id: check-vcs-permalinks
12-
- id: check-yaml
13-
- id: debug-statements
14-
- id: end-of-file-fixer
15-
- id: mixed-line-ending
7+
- id: check-ast
8+
- id: check-docstring-first
9+
- id: check-json
10+
- id: check-toml
11+
- id: check-vcs-permalinks
12+
- id: check-yaml
13+
- id: debug-statements
14+
exclude: '^jsonschema/tests/_suite.py$'
15+
- id: end-of-file-fixer
16+
- id: mixed-line-ending
1617
args: [--fix, lf]
17-
- id: trailing-whitespace
18-
- repo: https://github.com/PyCQA/isort
18+
- id: trailing-whitespace
19+
- repo: https://github.com/PyCQA/isort
1920
rev: 5.10.1
2021
hooks:
2122
- id: isort

jsonschema/tests/_suite.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ def validate(self, Validator, **kwargs):
204204
id_of=Validator.ID_OF,
205205
)
206206
validator = Validator(schema=self.schema, resolver=resolver, **kwargs)
207+
if os.environ.get("JSON_SCHEMA_DEBUG", "0") != "0":
208+
breakpoint()
207209
validator.validate(instance=self.data)
208210

209211
def validate_ignoring_errors(self, Validator): # pragma: no cover

0 commit comments

Comments
 (0)