@pytest.mark.parametrize('mock_module', ['mock', 'unittest.mock'])
def test_doctest_mock_objects_dont_recurse_missbehaved(mock_module, testdir):
    pytest.importorskip(mock_module)
    testdir.makepyfile("\n        from {mock_module} import call\n        class Example(object):\n            '''\n            >>> 1 + 1\n            2\n            '''\n        ".format(mock_module=mock_module))
    result = testdir.runpytest('--doctest-modules')
    result.stdout.fnmatch_lines(['* 1 passed *'])
@pytest.mark.parametrize('mock_module', ['mock', 'unittest.mock'])
def test_doctest_mock_objects_dont_recurse_missbehaved(mock_module, testdir):
    pytest.importorskip(mock_module)
    testdir.makepyfile("\n        from {mock_module} import call\n        class Example(object):\n            '\n            >>> 1 + 1\n            2\n            '\n        ".format(mock_module=mock_module))
    result = testdir.runpytest('--doctest-modules')
    result.stdout.fnmatch_lines(['* 1 passed *'])