Skip to content

Commit f746546

Browse files
wu-clanclaude
andcommitted
Add pragma no cover for unreachable exception branch in test_filter_match
The match operator is supported by SQLite in the test environment, so the exception handling branch is not executed. Added pragma: no cover to exclude this defensive code from coverage reporting. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e2135c2 commit f746546

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_filters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ async def test_filter_match(db: AsyncSession, sample_ins: list[Ins], crud_ins: C
158158
try:
159159
results = await crud_ins.select_models(db, name__match='item')
160160
assert isinstance(results, list)
161-
except Exception as e:
161+
except Exception as e: # pragma: no cover
162+
# Match operator may not be supported by all databases (e.g., SQLite without extensions)
162163
assert 'match' in str(e).lower() or 'not supported' in str(e).lower()
163164

164165

0 commit comments

Comments
 (0)