Skip to content

Commit

Permalink
Avoid test collection import errors due to optional dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSosic committed Jan 14, 2025
1 parent f89f9ef commit 8282b9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 3 additions & 1 deletion baybe/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@


##### Warnings #####


class UnusedObjectWarning(UserWarning):
"""
A method or function was called with undesired arguments which indicates an
Expand Down Expand Up @@ -59,7 +61,7 @@ class NumericalUnderflowError(Exception):
"""A computation would lead to numerical underflow."""


class OptionalImportError(Exception):
class OptionalImportError(ImportError):
"""An attempt was made to import an optional but uninstalled dependency."""


Expand Down
10 changes: 3 additions & 7 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ addopts =
--doctest-modules
--ignore=examples
--ignore=docs

; TODO: The following modules are ignored due to optional dependencies, which
; otherwise break test collection in core test environment.
; Probably, there is a more elegant solution to it.
--ignore=baybe/_optional
--ignore=baybe/utils/chemistry.py
--ignore=tests/simulate_telemetry.py

; Avoids import errors due to optional dependencies
--doctest-ignore-import-errors
testpaths =
baybe
tests

0 comments on commit 8282b9a

Please sign in to comment.