'Will return the arguments with a custom build_ext which knows how to
check whether they should be built.'

def test_conditionalExtensions(self):

    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])
    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])
