예제 #1
0
 def options(self, parser, env=os.environ):
     Plugin.options(self, parser, env)
     parser.add_option(
         "-u", "--select-unittests", action="store_true",
         default=False, dest="select_unittests",
         help="Run all unittests"
     )
     parser.add_option(
         "--select-databasetests", action="store_true",
         default=False, dest="select_databasetests",
         help="Run all database tests"
     )
     parser.add_option(
         "--select-destructivedatabasetests", action="store_true",
         default=False, dest="select_destructivedatabasetests",
         help="Run all destructive database tests"
     )
     parser.add_option(
         "--select-httptests", action="store_true",
         default=False, dest="select_httptests",
         help="Run all HTTP tests"
     )
     parser.add_option(
         "--select-seleniumtests", action="store_true",
         default=False, dest="select_seleniumtests",
         help="Run all Selenium tests"
     )
예제 #2
0
 def options(self, parser, env=os.environ):
     Plugin.options(self, parser, env)
     
     parser.add_option(
         "", "--persist-test-database", action="store_true",
         default=env.get(self.env_opt), dest="persist_test_database",
         help="Do not flush database unless neccessary [%s]" % self.env_opt)
예제 #3
0
 def options(self, parser, env):
     Plugin.options(self, parser, env)
     parser.add_option('--id-file', action='store', dest='testIdFile',
                       default='.noseids',
                       help="Store test ids found in test runs in this "
                       "file. Default is the file .noseids in the "
                       "working directory.")
예제 #4
0
 def options(self, parser, env):
     Plugin.options(self, parser, env)
     parser.add_option(
         '--artifact-dir', action='store',
         dest='artifact_dir', metavar="DIR",
         help=("Root artifact directory for testrun. [Default " \
               "is new sub-dir under /tmp]"))
예제 #5
0
 def options(self, parser, env=os.environ):
     '''Add launch options for NoseXUnitLite'''
     # Call super
     Plugin.options(self, parser, env)
     # ---------------------------------------------------------------------
     # CORE
     # ---------------------------------------------------------------------
     # Add test target folder
     parser.add_option('--core-target',
                       action='store',
                       default = nconst.TARGET_CORE,
                       dest='core_target',
                       help='Output folder for test reports (default is %s).' % nconst.TARGET_CORE)
     # Add source folder
     parser.add_option('--source-folder',
                       action='store',
                       default=None,
                       dest='source',
                       help='Set source folder (optional). Add folder in sys.path.')
     # Search sources in source tree
     parser.add_option('--search-source',
                       action='store_true',
                       default=False,
                       dest='search_source',
                       help="Walk in the source folder to add deeper folders in sys.path if they don't contain __init__.py file. Works only if --source-folder is defined.")
     # Search tests in 
     parser.add_option('--search-test',
                       action='store_true',
                       default=False,
                       dest='search_test',
                       help='Search tests in folders with no __init__.py file (default: do nothing).')
 def options(self, parser, env):
     Plugin.options(self, parser, env)
     parser.add_option("--re-pattern",
                       dest="pattern", action="store",
                       default=env.get("NOSE_REGEX_PATTERN", "test.*"),
                       help=("Run test methods that have a method name \
                       matching this regular expression"))    
예제 #7
0
 def options(self, parser, env):
     Plugin.options(self, parser, env)
     parser.add_option('--mutations-path', action='store',
                       default='.',
                       dest='mutations_path',
                       help='Restrict mutations to source files in this path'
                            ' (default: current working directory)')
     parser.add_option('--mutations-exclude', action='store',
                       metavar='REGEX', default=None,
                       dest='mutations_exclude',
                       help='Exclude mutations for source files containing '
                             'this pattern (default: None)')
     parser.add_option('--mutations-exclude-lines', action='store',
                       metavar='REGEX',
                       default=self.exclude_lines_pattern,
                       dest='mutations_exclude_lines',
                       help='Exclude mutations for lines containing this '
                            'pattern (default: \'%s\'' %
                             self.exclude_lines_pattern)
     parser.add_option('--mutations-mutators-modules', action='store',
                       default='elcap.mutator',
                       dest='mutators_modules',
                       help='Comma separated list of modules where the '
                            'Mutators are defined.')
     parser.add_option('--mutations-mutators', action='store',
                       default='',
                       dest='mutators',
                       help='Comma separated list of mutators to use. '
                            'Example: BooleanMutator,NumberMutator. An '
                            'empty list implies all Mutators in the defined '
                            'modules will be used.')
예제 #8
0
파일: ipdoctest.py 프로젝트: kmike/ipython
 def options(self, parser, env=os.environ):
     # print "Options for nose plugin:", self.name # dbg
     Plugin.options(self, parser, env)
     parser.add_option(
         "--ipdoctest-tests",
         action="store_true",
         dest="ipdoctest_tests",
         default=env.get("NOSE_IPDOCTEST_TESTS", True),
         help="Also look for doctests in test modules. "
         "Note that classes, methods and functions should "
         "have either doctests or non-doctest tests, "
         "not both. [NOSE_IPDOCTEST_TESTS]",
     )
     parser.add_option(
         "--ipdoctest-extension",
         action="append",
         dest="ipdoctest_extension",
         help="Also look for doctests in files with " "this extension [NOSE_IPDOCTEST_EXTENSION]",
     )
     # Set the default as a list, if given in env; otherwise
     # an additional value set on the command line will cause
     # an error.
     env_setting = env.get("NOSE_IPDOCTEST_EXTENSION")
     if env_setting is not None:
         parser.set_defaults(ipdoctest_extension=tolist(env_setting))
예제 #9
0
 def options(self, parser, env):
     Plugin.options(self, parser, env)
     parser.add_option("--csv-file", \
                       dest="filename", \
                       action="store", \
                       default=env.get("NOSE_CSV_FILE", "log.csv"), \
                       help=("Name of the report"))
예제 #10
0
 def options(self, parser, env=os.environ):
     Plugin.options(self, parser, env)
     parser.add_option(
         "--with-dependency",
         action="store_true",
         dest="dependency",
         help="Order tests according to @requires decorators",
     )
예제 #11
0
    def options(self, parser, env=None):
        Plugin.options(self, parser, env)
        parser.add_option('--rapido-blue', action='store_true',
                          dest='rapido_blue',
                          default=False,
                          help=
                          "Use the color blue instead of \
green for successfull tests")
예제 #12
0
 def options(self, parser, env):
     """Register commmandline options.
     """
     Plugin.options(self, parser, env)
     parser.add_option(
         "--html-output",
         default=env.get('NOSE_OUTPUT_FILE'),
         dest="outputFile", help="Dest. of output file")
예제 #13
0
 def options(self, parser, env):
     """Register commandline options.
     """
     Plugin.options(self, parser, env)
     parser.add_option('--randomize', action='store_true', dest='randomize',
                       help="Randomize the order of the tests within a unittest.TestCase class")
     parser.add_option('--seed', action='store', dest='seed', default=None, type = long,
                       help="Initialize the seed for deterministic behavior in reproducing failed tests")
예제 #14
0
 def options(self, parser, env):
     Plugin.options(self, parser, env)
     parser.add_option(
         '--json-file', action='store',
         dest='json_file', metavar="FILE",
         default=env.get('NOSE_JSON_FILE', 'nosetests.json'),
         help=("Path to json file to store the report in. "
               "Default is nosetests.json in the working directory "
               "[NOSE_JSON_FILE]"))
예제 #15
0
 def options(self, parser, env):
     """Sets additional command line options."""
     Plugin.options(self, parser, env)
     parser.add_option('--dataproviders-first', action="store_true",
                       default=env.get('DATAPROVIDERS_FIRST', False),
                       dest="dataproviders_first",
                       help="If set, will call dataproviders, "
                            "when before finding tests."
                            "[DATAPROVIDERS_FIRST]")
예제 #16
0
 def options(self, parser, env=os.environ):
     """Sets additional command line options."""
     Plugin.options(self, parser, env)
     parser.add_option(
         '--lode-report', action='store',
         dest='lode_report', metavar="FILE",
         default=env.get('LODE_REPORT_FILE', 'lode-report.json'),
         help=("Path to xml file to store the lode report in. "
               "Default is lode-report.xml in the working directory "
               "[LODE_REPORT_FILE]"))
예제 #17
0
 def options(self, parser, env):
     """Sets additional command line options."""
     Plugin.options(self, parser, env)
     parser.add_option(
         '--html-file', action='store',
         dest='html_file', metavar="FILE",
         default=env.get('NOSE_HTML_FILE', 'nosetests.html'),
         help="Path to html file to store the report in. "
              "Default is nosetests.html in the working directory "
              "[NOSE_HTML_FILE]")
예제 #18
0
    def options(self, parser, env=None):
        Plugin.options(self, parser, env)
        omaker = make_option_maker(parser, dest_prefix = "dbdump",
                                   env_prefix = "NOSE_DBDUMP",
                                   cmdline_prefix = "dbdump")

        omaker('databases', action="append", help="Dump the selected databases")
        omaker('output', help="Path to store the database dump")
        omaker('dsn', help="engine://[user[:password]@]hostname[:port]")
        omaker('keep', action='store_true', help="Don't delete the database dump")
예제 #19
0
 def options(self, parser, env):
     """Register commandline options
     """
     Plugin.options(self, parser, env)
     parser.add_option(
         "--no-preload", action="store_false",
         default=not env.get("NOSE_NO_PRELOAD"), dest="preload",
         help="Don't preload any nose LazySuite so instead of a single "
         "subunit progress output, this will generate "
         "more than one. Useful if preloading all tests is not "
         "feasible [NOSE_NO_PRELOAD]")
예제 #20
0
    def options(self, parser, env=os.environ):
        """Add command-line options for this plugin"""
        env_opt = 'NOSE_WITH_%s' % self.name.upper()

        parser.add_option("--pymssql-section",
                          type="string",
                          default=env.get('PYMSSQL_TEST_CONFIG', 'DEFAULT'),
                          help="The name of the section to use from tests.cfg"
                        )

        Plugin.options(self, parser, env=env)
예제 #21
0
 def options(self, parser, env):
     """Register commandline options.
     """
     Plugin.options(self, parser, env)
     parser.add_option('--randomize', action='store_true', dest='randomize',
                       help="Randomize the order of the tests within a unittest.TestCase class")
     parser.add_option('--seed', action='store', dest='seed', default=None, type=int,
                       help="Initialize the seed for deterministic behavior in reproducing failed tests")
     parser.add_option('--class-specific', action="store_true", dest='class_specific',
                       help="Determines if test randomization should only used in classes marked by the "
                            "@randomize_tests decorator")
예제 #22
0
 def options(self, parser, env=os.environ):
     """Register commandline options.
     """
     Plugin.options(self, parser, env)
     parser.add_option('--keep-env', action='store_true', dest='keep_env', default=False,
                       help="Keep env files after running successfully")
     parser.add_option('--sleep-in-sec', type='int', default=0,
                       dest='sleep_in_sec',
                       help='Sleep time after ATS stop to allow enough time for async logs')
     parser.add_option('--standalone-server-port', type='string',
                       dest='standalone_server_port',
                       help="Allow standalone test with pre-deployed ATS server port")
예제 #23
0
 def options(self, parser, env):
     """
     Add options to command line.
     """
     Plugin.options(self, parser, env)
     parser.add_option('--xcoverage-file', action='store',
                       default=env.get('NOSE_XCOVER_FILE', 'coverage.xml'),
                       dest='xcoverage_file',
                       metavar="FILE",
                       help='Path to xml coverage report.'
                       'Default is coverage.xml in the working directory. '
                       '[NOSE_XCOVERAGE_FILE]')
예제 #24
0
파일: spec.py 프로젝트: ghickman/pinocchio
 def options(self, parser, env=os.environ):
     Plugin.options(self, parser, env)
     parser.add_option('--spec-color', action='store_true',
                       dest='spec_color',
                       default=env.get('NOSE_SPEC_COLOR'),
                       help="Show coloured (red/green) output for specifications "
                       "[NOSE_SPEC_COLOR]")
     parser.add_option('--spec-doctests', action='store_true',
                       dest='spec_doctests',
                       default=env.get('NOSE_SPEC_DOCTESTS'),
                       help="Include doctests in specifications "
                       "[NOSE_SPEC_DOCTESTS]")
예제 #25
0
	def options(self, parser, env = os.environ):
		logger.debug("options(self, parser, env = os.environ):...")
		
		parser.add_option(
			"--psprofile-file", 
			action = "store", 
			default = env.get("NOSE_PSP_FILE", "psprofile.json"), 
			dest = "psp_file", 
			metavar="FILE",
			help = "By Default a psprofile.json is generated in the current working directory")

		Plugin.options(self, parser, env)
예제 #26
0
 def options(self, parser, env=os.environ):
     Plugin.options(self, parser, env)
     opt = parser.add_option
     opt("--log-info", action="callback", type="string", callback=_log,
         help="turn on info logging for <LOG> (multiple OK)")
     opt("--log-debug", action="callback", type="string", callback=_log,
         help="turn on debug logging for <LOG> (multiple OK)")
     opt("--require", action="append", dest="require", default=[],
         help="require a particular driver or module version (multiple OK)")
     opt("--db", action="store", dest="db", default="sqlite",
         help="Use prefab database uri")
     opt('--dbs', action='callback', callback=_list_dbs,
         help="List available prefab dbs")
     opt("--dburi", action="store", dest="dburi",
         help="Database uri (overrides --db)")
     opt("--dropfirst", action="store_true", dest="dropfirst",
         help="Drop all tables in the target database first (use with caution on Oracle, "
         "MS-SQL)")
     opt("--mockpool", action="store_true", dest="mockpool",
         help="Use mock pool (asserts only one connection used)")
     opt("--zero-timeout", action="callback", callback=_zero_timeout,
         help="Set pool_timeout to zero, applies to QueuePool only")
     opt("--low-connections", action="store_true", dest="low_connections",
         help="Use a low number of distinct connections - i.e. for Oracle TNS"
     )
     opt("--enginestrategy", action="callback", type="string",
         callback=_engine_strategy,
         help="Engine strategy (plain or threadlocal, defaults to plain)")
     opt("--reversetop", action="store_true", dest="reversetop", default=False,
         help="Use a random-ordering set implementation in the ORM (helps "
               "reveal dependency issues)")
     opt("--with-cdecimal", action="store_true", dest="cdecimal", default=False,
         help="Monkeypatch the cdecimal library into Python 'decimal' for all tests")
     opt("--unhashable", action="store_true", dest="unhashable", default=False,
         help="Disallow SQLAlchemy from performing a hash() on mapped test objects.")
     opt("--noncomparable", action="store_true", dest="noncomparable", default=False,
         help="Disallow SQLAlchemy from performing == on mapped test objects.")
     opt("--truthless", action="store_true", dest="truthless", default=False,
         help="Disallow SQLAlchemy from truth-evaluating mapped test objects.")
     opt("--serverside", action="callback", callback=_server_side_cursors,
         help="Turn on server side cursors for PG")
     opt("--mysql-engine", action="store", dest="mysql_engine", default=None,
         help="Use the specified MySQL storage engine for all tables, default is "
              "a db-default/InnoDB combo.")
     opt("--table-option", action="append", dest="tableopts", default=[],
         help="Add a dialect-specific table option, key=value")
     opt("--write-profiles", action="store_true", dest="write_profiles", default=False,
             help="Write/update profiling data.")
     global file_config
     file_config = ConfigParser.ConfigParser()
     file_config.readfp(StringIO.StringIO(base_config))
     file_config.read(['test.cfg', os.path.expanduser('~/.satest.cfg')])
     config.file_config = file_config
예제 #27
0
 def options(self, parser, env):
     Plugin.options(self, parser, env)
     parser.add_option("--mutant-path", action="append",
                       default=env.get('NOSE_MUTANT_PATH'),
                       dest="mutant_path",
                       help="Restrict mutation to source files in this folder"
                       "[NOSE_MUTANT_PATH]")
     parser.add_option("--mutant-exclude", action="append",
                       default=env.get('NOSE_MUTANT_EXCLUDE'),
                       dest="mutant_exclude",
                       help="Exclude mutation on source files found in this folder"
                       "[NOSE_MUTANT_EXCLUDE]")
예제 #28
0
 def options(self, parser, env=os.environ):
     Plugin.options(self, parser, env)
     parser.add_option("--html-report-file",
                          action="store",
                          #default="nose_report.html",
                          dest="report_file",
                          help="File to output HTML report to")
     parser.add_option("--html-template-file",
                          action="store",
                          default= html_path / default_template,
                          dest="template_file",
                          help="jinja template used to output HTML ")
예제 #29
0
파일: plugin.py 프로젝트: yanne/spec
 def options(self, parser, env=os.environ):
     Plugin.options(self, parser, env)
     parser.add_option('--no-spec-color', action='store_true',
                       dest='no_spec_color',
                       default=env.get('NOSE_NO_SPEC_COLOR'),
                       help="Don't show colors with --with-spec"
                       "[NOSE_NO_SPEC_COLOR]")
     parser.add_option('--spec-doctests', action='store_true',
                       dest='spec_doctests',
                       default=env.get('NOSE_SPEC_DOCTESTS'),
                       help="Include doctests in specifications "
                       "[NOSE_SPEC_DOCTESTS]")
예제 #30
0
 def options(self, parser, env):
     """Register commandline options.
     """
     Plugin.options(self, parser, env)
     parser.add_option('--id-file', action='store', dest='testIdFile',
                       default='.noseids', metavar="FILE",
                       help="Store test ids found in test runs in this "
                       "file. Default is the file .noseids in the "
                       "working directory.")
     parser.add_option('--failed', action='store_true',
                       dest='failed', default=False,
                       help="Run the tests that failed in the last "
                       "test run.")
예제 #31
0
 def options(self, parser, env):
     Plugin.options(self, parser, env)
     parser.add_option(
         "--mutant-path",
         action="append",
         default=env.get('NOSE_MUTANT_PATH'),
         dest="mutant_path",
         help="Restrict mutation to source files in this folder"
         "[NOSE_MUTANT_PATH]")
     parser.add_option(
         "--mutant-exclude",
         action="append",
         default=env.get('NOSE_MUTANT_EXCLUDE'),
         dest="mutant_exclude",
         help="Exclude mutation on source files found in this folder"
         "[NOSE_MUTANT_EXCLUDE]")
예제 #32
0
    def options(self, parser, env=os.environ):
        Plugin.options(self, parser, env)
        opt = parser.add_option

        def make_option(name, **kw):
            callback_ = kw.pop("callback", None)
            if callback_:

                def wrap_(option, opt_str, value, parser):
                    callback_(opt_str, value, parser)

                kw["callback"] = wrap_
            opt(name, **kw)

        plugin_base.setup_options(make_option)
        plugin_base.read_config()
예제 #33
0
    def options(self, parser, env=os.environ):
        Plugin.options(self, parser, env)
        parser.add_option('--html-testsuite-name',
                          action='store',
                          dest='html_testsuite_name',
                          metavar="PACKAGE",
                          default=env.get('NOSE_TESTSUITE_NAME', 'Nosetests'),
                          help=("Name of the testsuite."
                                "Default testsuite name is Nosetests."))

        parser.add_option('--html-file',
                          action='store',
                          dest='html_file',
                          metavar="FILE",
                          default=env.get('NOSE_HTML_FILE', 'nosetests.html'),
                          help=("html file to store the report in."
                                "Default is nosetests.html."))
예제 #34
0
 def options(self, parser, env=os.environ):
     Plugin.options(self, parser, env)
     parser.add_option('--no-spec-color',
                       action='store_true',
                       dest='no_spec_color',
                       default=env.get('NOSE_NO_SPEC_COLOR'),
                       help="Don't show colors with --with-spec"
                       "[NOSE_NO_SPEC_COLOR]")
     parser.add_option('--spec-doctests',
                       action='store_true',
                       dest='spec_doctests',
                       default=env.get('NOSE_SPEC_DOCTESTS'),
                       help="Include doctests in specifications "
                       "[NOSE_SPEC_DOCTESTS]")
     parser.add_option('--no-detailed-errors',
                       action='store_false',
                       dest='detailedErrors',
                       help="Force detailed errors off")
예제 #35
0
    def options(self, parser, env):
        """Add plugin specific options."""

        parser.add_option('--lettuce-path',
                          help=("Set the base path for feature discovery. "
                                "Default: ./features"),
                          dest='lettuce_path')

        parser.add_option('--lettuce-verbosity',
                          default=4,
                          help="Set the verbosity for the lettuce runner.",
                          dest='lettuce_verbosity')

        parser.add_option('--lettuce-scenarios',
                          help="Comma seperated list of scenarios to run.",
                          dest="lettuce_scenarios")

        Plugin.options(self, parser, env)
예제 #36
0
 def options(self, parser, env):
     """Register commandline options.
     """
     Plugin.options(self, parser, env)
     parser.add_option('--id-file',
                       action='store',
                       dest='testIdFile',
                       default='.noseids',
                       metavar="FILE",
                       help="Store test ids found in test runs in this "
                       "file. Default is the file .noseids in the "
                       "working directory.")
     parser.add_option('--failed',
                       action='store_true',
                       dest='failed',
                       default=False,
                       help="Run the tests that failed in the last "
                       "test run.")
예제 #37
0
 def options(self, parser, env):
     """Sets additional command line options."""
     Plugin.options(self, parser, env)
     parser.add_option('--dataproviders-first', action="store_true",
                       default=env.get('DATAPROVIDERS_FIRST', False),
                       dest="dataproviders_first",
                       help="Call dataproviders before tests collecting."
                            "[DATAPROVIDERS_FIRST]")
     parser.add_option('--dataproviders-verbose', action="store_true",
                       default=env.get('DATAPROVIDERS_VERBOSE', False),
                       dest="dataproviders_verbose",
                       help="Show dataproviders data by inserting it into test names"
                            "[DATAPROVIDERS_VERBOSE]")
     parser.add_option('--log-test-arguments', action="store_true",
                       default=env.get('LOG_TEST_ARGUMENTS', False),
                       dest="log_test_arguments",
                       help="Enable logging arguments passed in test"
                            "[LOG_TEST_ARGUMENTS]")
예제 #38
0
 def options(self, parser, env):
     """Sets additional command line options."""
     Plugin.options(self, parser, env)
     parser.add_option(
         '--html-report', action='store',
         dest='html_file', metavar="FILE",
         default=env.get('NOSE_HTML_FILE', 'nosetests.html'),
         help="Path to html file to store the report in. "
              "Default is nosetests.html in the working directory "
              "[NOSE_HTML_FILE]")
     parser.add_option(
         '--html-report-template', action='store',
         dest='html_template', metavar="FILE",
         default=env.get('NOSE_HTML_TEMPLATE_FILE',
                         os.path.join(os.path.dirname(__file__), "templates", "report2.jinja2")),
         help="Path to html template file in with jinja2 format."
              "Default is report.html in the lib sources"
              "[NOSE_HTML_TEMPLATE_FILE]")
예제 #39
0
 def options(self, parser, env):
     """Sets additional command line options.
     :param env:
     :param parser:
     """
     Plugin.options(self, parser, env)
     parser.add_option('--autopsy-summary-log',
                       action='store',
                       dest='autopsy_summary_file',
                       metavar="FILE",
                       default=env.get('AUTOPSY_AUTO_FILE', 'summary.txt'),
                       help=(""))
     parser.add_option('--autopsy-mailto',
                       action='store',
                       dest='mailto',
                       metavar="FILE",
                       default=env.get('AUTOPSY_MAIL_TO', ''),
                       help=(""))
예제 #40
0
 def options(self, parser, env=os.environ):
     parser.add_option(
         '--remote-server',
         help=
         'Use a remote server to run the tests, must pass in the server address',
     )
     parser.add_option(
         '--to-from-ports',
         help=
         'Should be of the form x:y where x is the port that needs to be forwarded to the server and y is the port that the server needs forwarded back to the localhost',
         default='4444:8001',
     )
     parser.add_option(
         '--username',
         help=
         'The username with which to create the ssh tunnel to the remote server',
         default=None,
     )
     Plugin.options(self, parser, env)
예제 #41
0
 def options(self, parser, env=os.environ):
     Plugin.options(self, parser, env)
     parser.add_option('--doctest-tests', action='store_true',
                       dest='doctest_tests',
                       default=env.get('NOSE_DOCTEST_TESTS',True),
                       help="Also look for doctests in test modules. "
                       "Note that classes, methods and functions should "
                       "have either doctests or non-doctest tests, "
                       "not both. [NOSE_DOCTEST_TESTS]")
     parser.add_option('--doctest-extension', action="append",
                       dest="doctestExtension",
                       help="Also look for doctests in files with "
                       "this extension [NOSE_DOCTEST_EXTENSION]")
     # Set the default as a list, if given in env; otherwise
     # an additional value set on the command line will cause
     # an error.
     env_setting = env.get('NOSE_DOCTEST_EXTENSION')
     if env_setting is not None:
         parser.set_defaults(doctestExtension=tolist(env_setting))
예제 #42
0
 def options(self, parser, env=os.environ):
     parser.add_option('--selenium-ss-dir',
                       help='Directory for failure screen shots.')
     parser.add_option(
         '--headless',
         help=
         "Run the Selenium tests in a headless mode, with virtual frames starting with the given index (eg. 1)",
         default=None)
     parser.add_option('--driver-type',
                       help='The type of driver that needs to be created',
                       default='firefox')
     parser.add_option(
         '--remote-server-address',
         help=
         'Use a remote server to run the tests, must pass in the server address',
         default='localhost')
     parser.add_option('--selenium-port',
                       help='The port for the selenium server',
                       default='4444')
     Plugin.options(self, parser, env)
예제 #43
0
 def options(self, parser, env):
     """
     Add options to command line.
     """
     Plugin.options(self, parser, env)
     parser.add_option('--xcoverage-file',
                       action='store',
                       default=env.get('NOSE_XCOVER_FILE', 'coverage.xml'),
                       dest='xcoverage_file',
                       metavar="FILE",
                       help='Path to xml coverage report.'
                       'Default is coverage.xml in the working directory. '
                       '[NOSE_XCOVERAGE_FILE]')
     parser.add_option(
         '--xcoverage-to-stdout',
         action='store',
         default=env.get('NOSE_XCOVER_TO_STDOUT', True),
         dest='xcoverage_to_stdout',
         help='Print coverage information to stdout.'
         'Default is True (output coverage information to stdout). '
         '[NOSE_XCOVER_TO_STDOUT]')
예제 #44
0
 def options(self, parser, env=os.environ):
     Plugin.options(self, parser, env)
     parser.add_option('--no-spec-color', action='store_true',
                       dest='no_spec_color',
                       default=env.get('NOSE_NO_SPEC_COLOR'),
                       help="Don't show colors with --with-spec"
                       "[NOSE_NO_SPEC_COLOR]")
     parser.add_option('--spec-doctests', action='store_true',
                       dest='spec_doctests',
                       default=env.get('NOSE_SPEC_DOCTESTS'),
                       help="Include doctests in specifications "
                       "[NOSE_SPEC_DOCTESTS]")
     parser.add_option('--no-detailed-errors', action='store_false',
                       dest='detailedErrors',
                       help="Force detailed errors off")
     parser.add_option('--with-timing', action='store_true',
                       help="Display timing info for slow tests")
     parser.add_option('--timing-threshold',
                       metavar="SECONDS",
                       type=float,
                       default=0.1,
                       help="Number (float) of seconds above which to display test runtime. Default: 0.1")
예제 #45
0
 def options(self, parser, env=os.environ):
     Plugin.options(self, parser, env)
     parser.add_option(
         '--spec-color',
         action='store_true',
         dest='spec_color',
         default=env.get('NOSE_SPEC_COLOR'),
         help="Show coloured (red/green) output for specifications "
         "[NOSE_SPEC_COLOR]")
     parser.add_option('--spec-doctests',
                       action='store_true',
                       dest='spec_doctests',
                       default=env.get('NOSE_SPEC_DOCTESTS'),
                       help="Include doctests in specifications "
                       "[NOSE_SPEC_DOCTESTS]")
     parser.add_option(
         '--spec-file',
         action='store',
         dest='spec_file',
         default=env.get('NOSE_SPEC_FILE'),
         help="Write specification to the file instead of stderr "
         "[NOSE_SPEC_FILE]")
예제 #46
0
 def options(self, parser, env):
     Plugin.options(self, parser, env)
     parser.add_option(
         '--nose-uploader-url',
         action='store',
         dest='nose_uploader_url',
         metavar='URL',
         default=env.get('NOSE_UPLOADER_URL'),
         help=("URL to where the test results should be uploaded."
               "It can be local path as well as remote url."
               "Default is current working directory json files."
               "[NOSE_UPLOADER_URL]"))
     parser.add_option(
         '--nose-uploader-user',
         action='store',
         dest='nose_uploader_user',
         metavar='USER',
         default=env.get('NOSE_UPLOADER_USER'),
         help=("Upload server username."
               "Used only when NOSE_UPLOADER_URL is an http(s) link."
               "[NOSE_UPLOADER_USER]"))
     parser.add_option(
         '--nose-uploader-pass',
         action='store',
         dest='nose_uploader_pass',
         metavar='PASSWORD',
         default=env.get('NOSE_UPLOADER_PASS'),
         help=("Upload server password."
               "Used only when NOSE_UPLOADER_PASS is an http(s) link."
               "[NOSE_UPLOADER_PASS]"))
     parser.add_option(
         '--nose-uploader-vars',
         action='append',
         dest='nose_uploader_vars',
         metavar='PAIR',
         help=("Additional variables included with with test result upload."
               "The format is a key=value pair"))
예제 #47
0
 def options(self, parser, env):
     Plugin.options(self, parser, env)
     parser.add_option("--csv-file",
        dest="filename", action="store",
        default=env.get("NOSE_CSV_FILE", "log.csv"),
        help=("Name of the report"))
예제 #48
0
    def options(self, parser, env=os.environ):

        Plugin.options(self, parser, env)
        parser.add_option('--config-file',
                          action='store',
                          dest='config_file',
                          help="Load options from ConfigParser compliant config file. " +
                               "Values in config file will override values sent on the " +
                               "command line."
        )
        valid_location_options = ['local', 'remote', 'grid', 'sauce']
        parser.add_option('--browser-location',
                          action='store',
                          choices=valid_location_options,
                          default=env.get('SELENIUM_BROWSER_LOCATION', 'local'),
                          dest='browser_location',
                          help="Run the browser in this location (default %default, options " +
                               self._stringify_options(valid_location_options) +
                               "). May be stored in environmental variable SELENIUM_BROWSER_LOCATION."
        )
        parser.add_option('--browser',
                          action='store',
                          default=env.get('SELENIUM_BROWSER', 'FIREFOX'),
                          dest='browser',
                          help="Run this type of browser (default %default). " +
                               "run --browser-help for a list of what browsers are available. " +
                               "May be stored in environmental variable SELENIUM_BROWSER."
        )
        parser.add_option('--browser-help',
                          action='store_true',
                          dest='browser_help',
                          help="Get a list of what OS, BROWSER, and BROWSER_VERSION combinations are available."
        )
        parser.add_option('--build',
                          action='store',
                          dest='build',
                          default=None,
                          metavar='str',
                          help='build identifier (for continuous integration). ' +
                               'Only used for sauce.'
        )
        parser.add_option('--browser-version',
                          action='store',
                          type='str',
                          default="",
                          dest='browser_version',
                          help='Run this version of the browser. ' +
                               '(default: %default implies latest.)'
        )
        parser.add_option('--os',
                          action='store',
                          dest='os',
                          default=None,
                          help="Run the browser on this operating system. " +
                               "(default: %default, required for grid or sauce)"
        )
        parser.add_option('--grid-address',
                          action='store',
                          dest='grid_address',
                          default=env.get('SELENIUM_GRID_ADDRESS', ''),
                          metavar='str',
                          help='host that selenium grid is listening on. ' +
                               '(default: %default) May be stored in environmental ' +
                               'variable SELENIUM_GRID_ADDRESS.'
        )
        parser.add_option('--grid-port',
                          action='store',
                          dest='grid_port',
                          type='int',
                          default=4444,
                          metavar='num',
                          help='port that selenium grid is listening on. ' +
                               '(default: %default)'
        )
        parser.add_option('--remote-address',
                          action='store',
                          dest='remote_address',
                          default=env.get('REMOTE_SELENIUM_ADDRESS', ''),
                          metavar='str',
                          help='host that remote selenium server is listening on. ' +
                               'May be stored in environmental variable REMOTE_SELENIUM_ADDRESS.'
        )
        parser.add_option('--remote-port',
                          action='store',
                          dest='remote_port',
                          type='int',
                          default=4444,
                          metavar='num',
                          help='port that remote selenium server is listening on. ' +
                               '(default: %default)'
        )
        parser.add_option('--timeout',
                          action='store',
                          type='int',
                          default=60,
                          metavar='num',
                          help='timeout (in seconds) for page loads, etc. ' +
                               '(default: %default)'
        )
        parser.add_option('--sauce-username',
                          action='store',
                          default=env.get('SAUCE_USERNAME', []),
                          dest='sauce_username',
                          metavar='str',
                          help='username for sauce labs account. ' +
                               'May be stored in environmental variable SAUCE_USERNAME.'
        )
        parser.add_option('--sauce-apikey',
                          action='store',
                          default=env.get('SAUCE_APIKEY', []),
                          dest='sauce_apikey',
                          metavar='str',
                          help='API Key for sauce labs account. ' +
                               'May be stored in environmental variable SAUCE_APIKEY.'
        )
        parser.add_option('--saved-files-storage',
                          action='store',
                          default=env.get('SAVED_FILES_PATH', ""),
                          dest='saved_files_storage',
                          metavar='PATH',
                          help='Full path to place to store screenshots and html dumps. ' +
                               'May be stored in environmental variable SAVED_FILES_PATH.'
        )
예제 #49
0
 def options(self, parser, env):
     Plugin.options(self, parser, env)
예제 #50
0
 def options(self, parser, env):
     return Plugin.options(self, parser, env)
예제 #51
0
 def options(self, parser, env=os.environ):
     """New plugin API: override to just set options. Implement
     this method instead of addOptions or add_options for normal
     options behavior with protection from OptionConflictErrors.
     """
     Plugin.options(self, parser, env)
예제 #52
0
    def options(self, parser, env):
        """Register commandline options
"""
        Plugin.options(self, parser, env)
예제 #53
0
 def options(self, parser, env):
     """Sets additional command line options."""
     Plugin.options(self, parser, env)
예제 #54
0
 def options(self, parser, env=os.environ):
     Plugin.options(self, parser, env)
예제 #55
0
 def options(self, parser, env):
     """ Configure with command line option '--filetype'. """
     Plugin.options(self, parser, env)
     parser.add_option('--filetype',
                       action='append',
                       help='Specify additional filetypes to monitor.')
예제 #56
0
    def options(self, parser, env=os.environ):
        Plugin.options(self, parser, env)
        opt = parser.add_option
        opt("--log-info",
            action="callback",
            type="string",
            callback=_log,
            help="turn on info logging for <LOG> (multiple OK)")
        opt("--log-debug",
            action="callback",
            type="string",
            callback=_log,
            help="turn on debug logging for <LOG> (multiple OK)")
        opt("--require",
            action="append",
            dest="require",
            default=[],
            help="require a particular driver or module version (multiple OK)")
        opt("--db",
            action="store",
            dest="db",
            default="sqlite",
            help="Use prefab database uri")
        opt('--dbs',
            action='callback',
            callback=_list_dbs,
            help="List available prefab dbs")
        opt("--dburi",
            action="store",
            dest="dburi",
            help="Database uri (overrides --db)")
        opt("--dropfirst",
            action="store_true",
            dest="dropfirst",
            help=
            "Drop all tables in the target database first (use with caution on Oracle, "
            "MS-SQL)")
        opt("--mockpool",
            action="store_true",
            dest="mockpool",
            help="Use mock pool (asserts only one connection used)")
        opt("--enginestrategy",
            action="callback",
            type="string",
            callback=_engine_strategy,
            help="Engine strategy (plain or threadlocal, defaults to plain)")
        opt("--reversetop",
            action="store_true",
            dest="reversetop",
            default=False,
            help="Use a random-ordering set implementation in the ORM (helps "
            "reveal dependency issues)")
        opt("--unhashable",
            action="store_true",
            dest="unhashable",
            default=False,
            help=
            "Disallow SQLAlchemy from performing a hash() on mapped test objects."
            )
        opt("--noncomparable",
            action="store_true",
            dest="noncomparable",
            default=False,
            help=
            "Disallow SQLAlchemy from performing == on mapped test objects.")
        opt("--truthless",
            action="store_true",
            dest="truthless",
            default=False,
            help=
            "Disallow SQLAlchemy from truth-evaluating mapped test objects.")
        opt("--serverside",
            action="callback",
            callback=_server_side_cursors,
            help="Turn on server side cursors for PG")
        opt("--mysql-engine",
            action="store",
            dest="mysql_engine",
            default=None,
            help=
            "Use the specified MySQL storage engine for all tables, default is "
            "a db-default/InnoDB combo.")
        opt("--table-option",
            action="append",
            dest="tableopts",
            default=[],
            help="Add a dialect-specific table option, key=value")

        global file_config
        file_config = ConfigParser.ConfigParser()
        file_config.readfp(StringIO.StringIO(base_config))
        file_config.read(['test.cfg', os.path.expanduser('~/.satest.cfg')])
        config.file_config = file_config
예제 #57
0
 def options(self, parser, env=os.environ):
     Plugin.options(self, parser, env)
     opt = parser.add_option
     opt("--log-info",
         action="callback",
         type="string",
         callback=_log,
         help="turn on info logging for <LOG> (multiple OK)")
     opt("--log-debug",
         action="callback",
         type="string",
         callback=_log,
         help="turn on debug logging for <LOG> (multiple OK)")
     opt("--require",
         action="append",
         dest="require",
         default=[],
         help="require a particular driver or module version (multiple OK)")
     opt("--db",
         action="store",
         dest="db",
         default="default",
         help="Use prefab database uri")
     opt('--dbs',
         action='callback',
         callback=_list_dbs,
         help="List available prefab dbs")
     opt("--dburi",
         action="store",
         dest="dburi",
         help="Database uri (overrides --db)")
     opt("--dropfirst",
         action="store_true",
         dest="dropfirst",
         help="Drop all tables in the target database first")
     opt("--mockpool",
         action="store_true",
         dest="mockpool",
         help="Use mock pool (asserts only one connection used)")
     opt("--low-connections",
         action="store_true",
         dest="low_connections",
         help=
         "Use a low number of distinct connections - i.e. for Oracle TNS")
     opt("--enginestrategy",
         action="callback",
         type="string",
         callback=_engine_strategy,
         help="Engine strategy (plain or threadlocal, defaults to plain)")
     opt("--reversetop",
         action="store_true",
         dest="reversetop",
         default=False,
         help="Use a random-ordering set implementation in the ORM (helps "
         "reveal dependency issues)")
     opt("--requirements",
         action="callback",
         type="string",
         callback=_requirements_opt,
         help="requirements class for testing, overrides setup.cfg")
     opt("--with-cdecimal",
         action="store_true",
         dest="cdecimal",
         default=False,
         help=
         "Monkeypatch the cdecimal library into Python 'decimal' for all tests"
         )
     opt("--unhashable",
         action="store_true",
         dest="unhashable",
         default=False,
         help=
         "Disallow SQLAlchemy from performing a hash() on mapped test objects."
         )
     opt("--noncomparable",
         action="store_true",
         dest="noncomparable",
         default=False,
         help=
         "Disallow SQLAlchemy from performing == on mapped test objects.")
     opt("--truthless",
         action="store_true",
         dest="truthless",
         default=False,
         help=
         "Disallow SQLAlchemy from truth-evaluating mapped test objects.")
     opt("--serverside",
         action="callback",
         callback=_server_side_cursors,
         help="Turn on server side cursors for PG")
     opt("--mysql-engine",
         action="store",
         dest="mysql_engine",
         default=None,
         help=
         "Use the specified MySQL storage engine for all tables, default is "
         "a db-default/InnoDB combo.")
     opt("--table-option",
         action="append",
         dest="tableopts",
         default=[],
         help="Add a dialect-specific table option, key=value")
     opt("--write-profiles",
         action="store_true",
         dest="write_profiles",
         default=False,
         help="Write/update profiling data.")
     global file_config
     file_config = configparser.ConfigParser()
     file_config.read(['setup.cfg', 'test.cfg'])
예제 #58
0
 def options(self, parser, env=os.environ):
     '''Add launch options for NoseXUnit'''
     # Call super
     Plugin.options(self, parser, env)
     # ---------------------------------------------------------------------
     # CORE
     # ---------------------------------------------------------------------
     # Add test target folder
     parser.add_option(
         '--core-target',
         action='store',
         default=nconst.TARGET_CORE,
         dest='core_target',
         help='Output folder for test reports (default is %s).' %
         nconst.TARGET_CORE)
     # Add source folder
     parser.add_option(
         '--source-folder',
         action='store',
         default=None,
         dest='source',
         help=
         'Set source folder (optional for core functionality, required for audit and coverage). Add folder in sys.path.'
     )
     # Search sources in source tree
     parser.add_option(
         '--search-source',
         action='store_true',
         default=False,
         dest='search_source',
         help=
         "Walk in the source folder to add deeper folders in sys.path if they don't contain __init__.py file. Works only if --source-folder is defined."
     )
     # Search tests in
     parser.add_option(
         '--search-test',
         action='store_true',
         default=False,
         dest='search_test',
         help=
         'Search tests in folders with no __init__.py file (default: do nothing).'
     )
     # Package to process in audit or coverage extensions
     parser.add_option(
         '--extra-include',
         action='append',
         default=[],
         dest='extra_include',
         help=
         'Include packages for audit or coverage processing (default: take all packages in --source-folder, except those defined in --extra-exclude).'
     )
     # Package to do not process in audit or coverage extensions
     parser.add_option(
         '--extra-exclude',
         action='append',
         default=nconst.AUDIT_COVER_EXCLUDE,
         dest='extra_exclude',
         help=
         'Exclude packages for audit or coverage processing (default: %s). Useless if --extra-include defined.'
         % (', '.join(nconst.AUDIT_COVER_EXCLUDE), ))
     # Package to do not process in audit or coverage extensions
     parser.add_option(
         '--extra-test-process',
         action='store_true',
         default=False,
         dest='extra_test_process',
         help=
         'Include packages matching the test pattern in audit or coverage processing (default: no).'
     )
     # ---------------------------------------------------------------------
     # AUDIT
     # ---------------------------------------------------------------------
     # Add option to enable audit
     parser.add_option('--enable-audit',
                       action='store_true',
                       default=False,
                       dest='audit',
                       help='Use PyLint to audit source code (default: no)')
     # Add PyLint target folder
     parser.add_option(
         '--audit-target',
         action='store',
         default=nconst.TARGET_AUDIT,
         dest='audit_target',
         help='Output folder for PyLint reports (default is %s).' %
         nconst.TARGET_AUDIT)
     # Add PyLint output
     parser.add_option(
         '--audit-output',
         action='store',
         default=nconst.AUDIT_DEFAULT_REPORTER,
         dest='audit_output',
         help='Output for audit reports: %s (default: %s).' %
         (', '.join(naudit.outputs()), nconst.AUDIT_DEFAULT_REPORTER))
     # Add PyLint configuration file
     parser.add_option('--audit-config',
                       action='store',
                       default=None,
                       dest='audit_config',
                       help='Configuration file for PyLint (optional).')
     # ---------------------------------------------------------------------
     # COVER
     # ---------------------------------------------------------------------
     # Add option to enable coverage
     parser.add_option(
         '--enable-cover',
         action='store_true',
         default=False,
         dest='cover',
         help='Use coverage to audit source code (default: no)')
     # Add coverage target folder
     parser.add_option(
         '--cover-target',
         action='store',
         default=nconst.TARGET_COVER,
         dest='cover_target',
         help='Output folder for coverage reports (default is %s).' %
         nconst.TARGET_COVER)
     # Check if clean folder
     parser.add_option(
         '--cover-clean',
         action='store_true',
         default=False,
         dest='cover_clean',
         help='Clean previous coverage results (default: no).')
     # Collect extra coverage files in target folder
     parser.add_option(
         '--cover-collect',
         action='store_true',
         default=False,
         dest='cover_collect',
         help=
         'Collect other coverage files potentially generated in cover target folder. These extra files should have the following pattern: %s.* (default: no).'
         % nconst.COVER_OUTPUT_BASE)