Skip to content

Commit 007c8ce

Browse files
MarcoGorelliluckyvs1
authored andcommitted
TST: Add hook for Disallow bare pytest.raises (pandas-dev#38799)
1 parent 260ab59 commit 007c8ce

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.pre-commit-config.yaml

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
minimum_pre_commit_version: 2.9.2
2+
exclude: ^LICENSES/|\.(html|csv|svg)$
23
repos:
34
- repo: https://github.com/python/black
45
rev: 20.8b1
@@ -121,6 +122,13 @@ repos:
121122
entry: python scripts/validate_unwanted_patterns.py --validation-type="private_function_across_module"
122123
types: [python]
123124
exclude: ^(asv_bench|pandas/tests|doc)/
125+
- id: unwanted-patterns-bare-pytest-raises
126+
name: Check for use of bare pytest raises
127+
language: python
128+
entry: python scripts/validate_unwanted_patterns.py --validation-type="bare_pytest_raises"
129+
types: [python]
130+
files: ^pandas/tests/
131+
exclude: ^pandas/tests/(computation|extension|io)/
124132
- id: inconsistent-namespace-usage
125133
name: 'Check for inconsistent use of pandas namespace in tests'
126134
entry: python scripts/check_for_inconsistent_pandas_namespace.py
@@ -137,7 +145,7 @@ repos:
137145
name: Check for use of foo.__class__ instead of type(foo)
138146
entry: \.__class__
139147
language: pygrep
140-
files: \.(py|pyx)$
148+
types_or: [python, cython]
141149
- id: unwanted-typing
142150
name: Check for use of comment-based annotation syntax and missing error codes
143151
entry: |
@@ -165,9 +173,8 @@ repos:
165173
rev: v3.4.0
166174
hooks:
167175
- id: end-of-file-fixer
168-
exclude: ^LICENSES/|\.(html|csv|txt|svg|py)$
176+
exclude: \.txt$
169177
- id: trailing-whitespace
170-
exclude: \.(html|svg)$
171178
- repo: https://github.com/codespell-project/codespell
172179
rev: v2.0.0
173180
hooks:

0 commit comments

Comments
 (0)