code: def test_check_restructuredtext(self):
      # let's see if it detects broken rest in long_description
      broken_rest = "title\n===\n\ntest"
      pkg_info, dist = self.create_dist(long_description=broken_rest)
      cmd = check(dist)
      cmd.check_restructuredtext()
      self.assertEqual(cmd._warnings, 1)
  
      # let's see if we have an error with strict=1
      metadata = {
          "url": "xxx",
          "author": "xxx",
          "author_email": "xxx",
          "name": "xxx",
          "version": "xxx",
          "long_description": broken_rest,
      }
      self.assertRaises(
          DistutilsSetupError,
          self._run,
          metadata,
          **{"strict": 1, "restructuredtext": 1},
      )
  
      # and non-broken rest, including a non-ASCII character to test #12114
      metadata["long_description"] = "title\n=====\n\ntest \u00df"
      cmd = self._run(metadata, strict=1, restructuredtext=1)
      self.assertEqual(cmd._warnings, 0)
  
file_path: catboost/contrib/tools/python/src/Lib/distutils/tests/test_check.py
imports: import textwrap
  import unittest
  from test.test_support import run_unittest
  from distutils.command.check import check, HAS_DOCUTILS
  from distutils.tests import support
  from distutils.errors import DistutilsSetupError
label_desc: Use image node_id 4 for calling the CheckTestCase obj's underlying member method code with example usage: obj.test_check_restructuredtext() without return types