Skip to content

Commit

Permalink
Still errors because mocked object is not used in python 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreDecan committed Jun 29, 2018
1 parent eb3d1f6 commit c3031a0
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tests/test_runner.py
Expand Up @@ -20,13 +20,17 @@ def runner(self, interpreter):
r.stop()

@pytest.fixture()
def mocked_runner(self, runner, mocker):
mocker.patch.object(runner, 'before_run')
mocker.patch.object(runner, 'before_execute')
mocker.patch.object(runner, 'after_execute')
mocker.patch.object(runner, 'after_run')
return runner

def mocked_runner(self, interpreter, mocker):
class MockedRunner(AsyncRunner):
before_run = mocker.MagicMock()
before_execute = mocker.MagicMock()
after_execute = mocker.MagicMock()
after_run = mocker.MagicMock()

r = MockedRunner(interpreter, interval=self.INTERVAL)
yield r
r.stop()

def test_not_yet_started(self, runner):
assert runner.interpreter.configuration == []

Expand Down

0 comments on commit c3031a0

Please sign in to comment.