

def test_rst_render_failure_warn(self):
    self.create_file('bad.rst', contents=dedent('\n    A bad link:\n\n    * `RB #2363 https://rbcommons.com/s/twitter/r/2363/>`_\n    '))
    bad_rst = html.make_target(':bad_rst', target_type=Page, source='bad.rst')
    self.set_options(ignore_failure=True)
    context = self.context(target_roots=[bad_rst])
    context.log.warn = mock.Mock()
    task = self.create_task(context)
    task.execute()
    self.assertEqual(1, context.log.warn.call_count)
    (args, kwargs) = context.log.warn.call_args
    self.assertEqual(0, len(kwargs))
    self.assertEqual(1, len(args))
    self.assertIn('bad.rst', args[0])
    with open(self.get_rendered_page(context, bad_rst, 'bad.html')) as fp:
        html = fp.read()
        self.assertIn('A bad link:', html)

dataset/ETHPy150Open pantsbuild/pants/tests/python/pants_test/backend/docgen/tasks/test_markdown_to_html.py MarkdownToHtmlTest.test_rst_render_failure_warn/VarMisuse@26/81 `self`->`html`