def test_auto_starts_the_recorder(self): # Mock a pytest request object request = mock.MagicMock() request.cls = request.module = None request.function.__name__ = 'test' pytest_fixture.betamax_session(request) self.mocked_betamax.start.assert_called_once_with()
def test_adds_stop_as_a_finalizer(self): # Mock a pytest request object request = mock.MagicMock() request.cls = request.module = None request.function.__name__ = 'test' pytest_fixture.betamax_session(request) assert request.addfinalizer.called is True request.addfinalizer.assert_called_once_with(self.mocked_betamax.stop)