Use native mocking

This commit is contained in:
Aaron Lichtman 2019-11-15 09:33:47 +01:00
parent 7a90f4076d
commit f0e5fe9653
No known key found for this signature in database
GPG key ID: 22368077DE9F9903
3 changed files with 5 additions and 18 deletions

View file

@ -1,12 +1,12 @@
from __future__ import unicode_literals
from __future__ import absolute_import
from unittest.mock import patch
from behave import given, when, then
from jrnl import cli, install, Journal, util, plugins
from jrnl import __version__
from dateutil import parser as date_parser
from collections import defaultdict
import mock
import os
import json
import yaml
@ -76,9 +76,9 @@ def set_config(context, config_file):
@when('we open the editor and exit')
@mock.patch('jrnl.util.get_text_from_editor', return_value="")
def open_editor_and_exit_without_entering_text(context, dead_param_to_satisfy_behave):
run(context, "jrnl")
def open_editor_and_exit_without_entering_text(context):
with patch('jrnl.util.get_text_from_editor', return_value=""):
run(context, "jrnl")
@when('we run "{command}" and enter')