Files
OpenBB/openbb_platform/tests/test_auto_build.py
Igor Radovanovic a255fa52a0 [Enhancement] - PyDocstyle Compliant (#6284)
* PyDocstyle Compliant batch 1

* Batch 2

* Batch 3

* Batch 4

* Batch 5

* Batch 6

* Batch 7

* Linting

* MyPy

* mypy things

* black

* more mypy

* black

* fix that

* black again

* undo that

* Fix error message

* pylint

---------

Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
2024-04-09 13:30:29 +00:00

36 lines
854 B
Python

"""Test the auto_build feature."""
import importlib
import sys
from unittest.mock import patch
import pytest
# pylint: disable=redefined-outer-name, unused-import, import-outside-toplevel
@pytest.fixture(autouse=True)
def setup_mocks():
"""Set up mocks for the test."""
with patch(
"openbb_core.app.static.package_builder.PackageBuilder.auto_build"
) as mock_auto_build:
mock_auto_build.return_value = None
yield mock_auto_build
@pytest.fixture
def openbb_module(setup_mocks):
"""Reload the openbb module."""
if "openbb" in sys.modules:
importlib.reload(sys.modules["openbb"])
else:
pass
return setup_mocks
@pytest.mark.integration
def test_autobuild_called(openbb_module):
"""Test that auto_build is called upon importing openbb."""
openbb_module.assert_called_once()