Skip to content

Conversation

@nguyenhuulocbb
Copy link

This PR fixes an INTERNALERROR in tests/unit/test_mlflow_manager.py on Python 3.12.

  • On macOS + Python 3.12, __builtins__ can be a dict, so __builtins__.__import__ raises an AttributeError.
  • The test only needs to simulate ImportError for mlflow, not depend on the internal shape of __builtins__.

Changes:

  • Use the builtins module and back up builtins.__import__ instead of __builtins__.__import__.
  • Keep the existing behavior of raising ImportError when mlflow is imported.

After this change:

pytest tests/unit/test_mlflow_manager.py -q

Fixes #72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant