Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pvk-developer committed Oct 15, 2024
1 parent 1aa7240 commit 2091c9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions copulas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from copy import deepcopy
from importlib.metadata import entry_points
from operator import attrgetter
from types import ModuleType

import numpy as np
import pandas as pd
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test___init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
from unittest import TestCase
from unittest.mock import MagicMock, call, patch
from unittest.mock import MagicMock, Mock, call, patch

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -464,14 +464,14 @@ def test__find_addons_bad_addon(entry_points_mock, warning_mock):

# Setup
def entry_point_error():
raise ValueError()
raise ValueError('bad value')

bad_entry_point = MagicMock()
bad_entry_point = Mock()
bad_entry_point.name = 'bad_entry_point'
bad_entry_point.value = 'bad_module'
bad_entry_point.load.side_effect = entry_point_error
entry_points_mock.return_value = [bad_entry_point]
msg = 'Failed to load "bad_entry_point" from "bad_module".'
msg = 'Failed to load "bad_entry_point" from "bad_module" with error:\nbad value'

# Run
_find_addons()
Expand Down

0 comments on commit 2091c9e

Please sign in to comment.