def test_option_exclude_module(pyi_builder):
 pyi_builder.test_source("\n        try:\n            import xml.sax\n            # Option --exclude-module=xml.sax did not work and the module\n            # was successfully imported.\n            raise SystemExit('Module xml.sax was excluded but it is '\n                             'bundled with the executable.')\n        except ImportError:\n            # The Import error is expected since PyInstaller should\n            # not bundle 'xml.sax' module.\n            pass\n        ", pyi_args=['--exclude-module', 'xml.sax'])

def test_option_exclude_module ( pyi_builder ) : pyi_builder . test_source ( "\n        try:\n            import xml.sax\n            # Option --exclude-module=xml.sax did not work and the module\n            # was successfully imported.\n            raise SystemExit('Module xml.sax was excluded but it is '\n                             'bundled with the executable.')\n        except ImportError:\n            # The Import error is expected since PyInstaller should\n            # not bundle 'xml.sax' module.\n            pass\n        " , pyi_args = [ '--exclude-module' , 'xml.sax' ] )
test to ensure that when using option --exclude-module=xml .