mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 21:50:28 +02:00
14 lines
516 B
Python
14 lines
516 B
Python
import importlib
|
|
import sys
|
|
|
|
# Ensure real optional dependencies are imported before tests that install stubs
|
|
# so that available packages (like ebooklib, bs4) aren't replaced with dummy modules.
|
|
for module_name in ("ebooklib", "bs4"):
|
|
if module_name not in sys.modules:
|
|
try:
|
|
importlib.import_module(module_name)
|
|
except Exception:
|
|
# On environments without the optional dependency, downstream tests
|
|
# will install lightweight stubs as needed.
|
|
pass
|