Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion sdv/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def check_sdv_versions_and_warn(synthesizer):
"""
current_community_version = getattr(version, 'community', None)
current_enterprise_version = getattr(version, 'enterprise', None)
if synthesizer._fitted:
if getattr(synthesizer, '_fitted', False):
fitted_community_version = getattr(synthesizer, '_fitted_sdv_version', None)
fitted_enterprise_version = getattr(synthesizer, '_fitted_sdv_enterprise_version', None)
community_mismatch = current_community_version != fitted_community_version
Expand Down
16 changes: 16 additions & 0 deletions tests/unit/test__utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,22 @@ def test_check_sdv_versions_and_warn_no_mismatch(mock_warnings):
mock_warnings.warn.assert_not_called()


@patch('sdv._utils.warnings')
def test_check_sdv_versions_and_warn_dayz(mock_warnings):
"""Test that the method works for ``DayZSynthesizer``."""
# Setup
synthesizer = Mock()
synthesizer._fitted = False

# Run
check_sdv_versions_and_warn(synthesizer)
synthesizer.__class__.__name__ = 'DayZSynthesizer'
check_sdv_versions_and_warn(synthesizer)

# Assert
mock_warnings.warn.assert_not_called()


def test_check_sdv_versions_and_warn_community_mismatch():
"""Test that warnings is raised when community version is mismatched."""
# Setup
Expand Down
Loading