Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] - Auto-build test #6271

Merged
merged 4 commits into from
Apr 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions openbb_platform/tests/test_auto_build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""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():
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):
montezdesousa marked this conversation as resolved.
Show resolved Hide resolved
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()
Loading