Commit e0be457
committed
[BUG](test): fix fastapi fixture registration and sqlite_fixture name
Three issues in chromadb/test/conftest.py broke test collection:
fastapi, async_fastapi, and fastapi_persistent were plain functions
without @pytest.fixture decorators. The system fixture uses
request.getfixturevalue() with their names as params, which requires
them to be registered fixtures. Without the decorator pytest raises
'fixture not found' at collection time.
The same three functions used return instead of yield from, so the
server teardown (system.stop() and proc.kill()) inside _fastapi_fixture
never ran after tests completed.
filtered_fixture_names() listed 'sqlite_fixture' which does not exist;
the registered parameterized fixture is named 'sqlite'. Tests
parameterized via the system fixture would skip the sqlite variant
silently.
Fixes: add @pytest.fixture() to the three functions, switch return to
yield from, and rename 'sqlite_fixture' to 'sqlite' in the default
fixture list.
Fixes #73951 parent 8bb6aed commit e0be457
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| 390 | + | |
390 | 391 | | |
391 | | - | |
| 392 | + | |
392 | 393 | | |
393 | 394 | | |
| 395 | + | |
394 | 396 | | |
395 | | - | |
| 397 | + | |
396 | 398 | | |
397 | 399 | | |
398 | 400 | | |
399 | 401 | | |
400 | 402 | | |
| 403 | + | |
401 | 404 | | |
402 | | - | |
| 405 | + | |
403 | 406 | | |
404 | 407 | | |
405 | 408 | | |
| |||
753 | 756 | | |
754 | 757 | | |
755 | 758 | | |
756 | | - | |
| 759 | + | |
757 | 760 | | |
758 | 761 | | |
759 | 762 | | |
| |||
0 commit comments