code: def test_setuptools_compat(self):
      import distutils.core, distutils.extension, distutils.command.build_ext
  
      saved_ext = distutils.extension.Extension
      try:
          # on some platforms, it loads the deprecated "dl" module
          test_support.import_module(
              "setuptools_build_ext", deprecated=True
          )
  
          # theses import patch Distutils' Extension class
          from setuptools_build_ext import (
              build_ext as setuptools_build_ext,
          )
          from setuptools_extension import Extension
  
          etree_c = os.path.join(self.tmp_dir, "lxml.etree.c")
          etree_ext = Extension("lxml.etree", [etree_c])
          dist = Distribution(
              {"name": "lxml", "ext_modules": [etree_ext]}
          )
          cmd = setuptools_build_ext(dist)
          cmd.ensure_finalized()
          cmd.inplace = 1
          cmd.distribution.package_dir = {"": "src"}
          cmd.distribution.packages = ["lxml", "lxml.html"]
          curdir = os.getcwd()
          ext = sysconfig.get_config_var("SO")
          wanted = os.path.join(curdir, "src", "lxml", "etree" + ext)
          path = cmd.get_ext_fullpath("lxml.etree")
          self.assertEqual(wanted, path)
      finally:
          # restoring Distutils' Extension class otherwise its broken
          distutils.extension.Extension = saved_ext
          distutils.core.Extension = saved_ext
          distutils.command.build_ext.Extension = saved_ext
  
imports: import sys
  import os
  from StringIO import StringIO
  import textwrap
  from distutils.core import Extension, Distribution
  from distutils.command.build_ext import build_ext
  from distutils import sysconfig
  from distutils.tests import support
  from distutils.errors import DistutilsSetupError, CompileError, DistutilsPlatformError
  import unittest
  from test import test_support
label_desc: Use image node_id 13 for calling the BuildExtTestCase obj's underlying member method code with example usage: obj.test_setuptools_compat() without return types