Skip to content

Commit 2b971b3

Browse files
committed
Disable pytest unraisable exception warnings in unitcov tests
During out coverage tests, pytest complains about an unraisable exception coming from Docling. Normally such an exception would be entirely ignored and unraised, but pytest is erroring out when it sees this exception. Docling behavior changed when it cannot find tesserocr recently by adding a garbage collection method on the tesseract model object, and if that fails to load properly it can throw this exception during garbage collection. However, it's a harmless exception since it failed to load anyway so we don't really care about it erroring out during garbage collection. Signed-off-by: Ben Browning <[email protected]>
1 parent 91319df commit 2b971b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ wheel_build_env = pkg
1919
deps = -r requirements-dev.txt
2020
commands =
2121
unit: {envpython} -m pytest {posargs:tests --ignore=tests/functional}
22-
unitcov: {envpython} -W error::UserWarning -m pytest --cov=instructlab.sdg --cov-report term --cov-report=html:coverage-{env_name} --cov-report=xml:coverage-{env_name}.xml --html=durations/{env_name}.html {posargs:tests --ignore=tests/functional -m "not (examples or gpu)"}
22+
unitcov: {envpython} -W error::UserWarning -m pytest --cov=instructlab.sdg --cov-report term --cov-report=html:coverage-{env_name} --cov-report=xml:coverage-{env_name}.xml --html=durations/{env_name}.html -p no:unraisableexception {posargs:tests --ignore=tests/functional -m "not (examples or gpu)"}
2323
functional: {envpython} -m pytest {posargs:tests/functional -m "not gpu"}
2424

2525
# format, check, and linting targets don't build and install the project to

0 commit comments

Comments
 (0)