Skip to content

Commit

Permalink
chore: fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Oct 3, 2023
1 parent 8f5cc72 commit 9e6cf5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions tests/tasks/test_vanity_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ def test_vanity_address_on_existing_alias(mock_keyring: dict[str, str]) -> None:

def test_vanity_address_on_termination(mocker: MockerFixture) -> None:
mock_pool = mocker.MagicMock()
mock_pool.apply_async.side_effect = KeyboardInterrupt()
mocker.patch("multiprocessing.Pool", return_value=mock_pool)
mock_pool.side_effect = KeyboardInterrupt()
# Mocking functions within the thread is tricky hence the use of side_effect on the range is used to simulate
# the KeyboardInterrupt
mocker.patch("algokit.core.tasks.vanity_address.range", side_effect=[range(2), KeyboardInterrupt()])

result = invoke("task vanity-address AAAAAA")

Expand Down

0 comments on commit 9e6cf5b

Please sign in to comment.