atropos/atroposlib/tests/test_env_imports.py
skyc1e 388137c3f1
fix: rename stale OpenaiConfig references to APIServerConfig
Three environment files still imported the old `OpenaiConfig` name,
which was renamed to `APIServerConfig`. This causes an ImportError
at module load time, making these environments unusable:

- environments/sft_loader_server.py
- environments/community/ufc_prediction_env/ufc_server.py
- environments/community/ufc_prediction_env/ufc_image_env.py

Also adds a lightweight import regression test.
2026-04-14 00:20:27 +02:00

22 lines
614 B
Python

"""Regression tests for environment module imports.
Ensures every environment module can be imported without errors
(e.g. no stale references to renamed symbols like OpenaiConfig).
"""
import importlib
import pytest
@pytest.mark.parametrize(
"module_path",
[
"environments.sft_loader_server",
"environments.community.ufc_prediction_env.ufc_server",
"environments.community.ufc_prediction_env.ufc_image_env",
],
)
def test_environment_module_imports(module_path):
"""Each environment module should import without ImportError."""
importlib.import_module(module_path)