mirror of
https://github.com/nvbn/thefuck.git
synced 2025-09-19 11:42:33 +01:00
#N/A Add ability to disable memoization in tests
This commit is contained in:
@@ -2,7 +2,7 @@ import pytest
|
||||
from mock import Mock
|
||||
from thefuck.utils import sudo_support, wrap_settings, memoize, get_closest
|
||||
from thefuck.types import Settings
|
||||
from tests.utils import Command
|
||||
from tests.utils import Command, no_memoize
|
||||
|
||||
|
||||
@pytest.mark.parametrize('override, old, new', [
|
||||
@@ -34,6 +34,15 @@ def test_memoize():
|
||||
fn.assert_called_once_with()
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('no_memoize')
|
||||
def test_no_memoize():
|
||||
fn = Mock(__name__='fn')
|
||||
memoized = memoize(fn)
|
||||
memoized()
|
||||
memoized()
|
||||
assert fn.call_count == 2
|
||||
|
||||
|
||||
class TestGetClosest(object):
|
||||
|
||||
def test_when_can_match(self):
|
||||
|
Reference in New Issue
Block a user