Skip to content
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
21 changes: 21 additions & 0 deletions tests/unit/functions/test_remote_function_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import inspect
import sys
from unittest.mock import patch

import bigframes_vendored.constants as constants
Expand Down Expand Up @@ -227,6 +228,26 @@ def test_get_updated_package_requirements_with_existing_cloudpickle():
assert result == expected


# Dynamically generate expected python versions for the test
_major = sys.version_info.major
_minor = sys.version_info.minor
_compat_version = f"python{_major}{_minor}"
_standard_version = f"python-{_major}.{_minor}"


@pytest.mark.parametrize(
"is_compat, expected_version",
[
(True, _compat_version),
(False, _standard_version),
],
)
def test_get_python_version(is_compat, expected_version):
"""Tests the python version for both standard and compat modes."""
result = _utils.get_python_version(is_compat=is_compat)
assert result == expected_version


def test_package_existed_helper():
"""Tests the _package_existed helper function directly."""
reqs = ["pandas==1.0", "numpy", "scikit-learn>=1.2.0"]
Expand Down