def test_conditionalExtensions(self):
        """
        Will return the arguments with a custom build_ext which knows how to
        check whether they should be built.
        """
        good_ext = ConditionalExtension("whatever", ["whatever.c"],
                                        condition=lambda b: True)
        bad_ext = ConditionalExtension("whatever", ["whatever.c"],
                                       condition=lambda b: False)

        args = getSetupArgs(extensions=[good_ext, bad_ext], readme=None)

        # ext_modules should be set even though it's not used.  See comment
        # in getSetupArgs
        self.assertEqual(args["ext_modules"], [good_ext, bad_ext])
        cmdclass = args["cmdclass"]
        build_ext = cmdclass["build_ext"]
        builder = build_ext(Distribution())
        builder.prepare_extensions()
        self.assertEqual(builder.extensions, [good_ext])

        Will return the arguments with a custom build_ext which knows how to
        check whether they should be built.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/test/test_setup.py