mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 15:23:51 +00:00
chore: block asyncio marks in tests
This commit is contained in:
parent
958fc92b1b
commit
3066f5992d
1 changed files with 16 additions and 0 deletions
|
@ -129,6 +129,22 @@ repos:
|
||||||
require_serial: true
|
require_serial: true
|
||||||
always_run: true
|
always_run: true
|
||||||
files: ^llama_stack/.*$
|
files: ^llama_stack/.*$
|
||||||
|
- id: forbid-pytest-asyncio
|
||||||
|
name: Block @pytest.mark.asyncio and @pytest_asyncio.fixture
|
||||||
|
entry: bash
|
||||||
|
language: system
|
||||||
|
types: [python]
|
||||||
|
pass_filenames: true
|
||||||
|
args:
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
grep -EnH '^[^#]*@pytest\.mark\.asyncio|@pytest_asyncio\.fixture' "$@" && {
|
||||||
|
echo;
|
||||||
|
echo "❌ Do not use @pytest.mark.asyncio or @pytest_asyncio.fixture."
|
||||||
|
echo " pytest is already configured with async-mode=auto."
|
||||||
|
echo;
|
||||||
|
exit 1;
|
||||||
|
} || true
|
||||||
|
|
||||||
ci:
|
ci:
|
||||||
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
|
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue