예제 #1
0
    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()
예제 #2
0
    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)