File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848logging .getLogger ('suds.client' ).setLevel (logging .CRITICAL )
4949logging .getLogger ('suds' ).setLevel (logging .ERROR )
5050
51+ _skip_slow = True
5152testdir = Path (__file__ ).resolve ().parent
5253testdatadir = testdir / "data"
5354
55+ def pytest_addoption (parser ):
56+ parser .addoption ("--no-skip-slow" , action = "store_true" , default = False ,
57+ help = "do not skip slow tests." )
58+
59+ def pytest_configure (config ):
60+ global _skip_slow
61+ _skip_slow = not config .getoption ("--no-skip-slow" )
62+ config .addinivalue_line ("markers" , "slow: mark a test as slow, "
63+ "the test will be skipped unless --no-skip-slow "
64+ "is set on the command line" )
65+
66+ def pytest_runtest_setup (item ):
67+ """Skip slow tests by default.
68+ """
69+ marker = item .get_closest_marker ("slow" )
70+ if marker is not None and _skip_slow :
71+ pytest .skip ("skip slow test" )
72+
5473def _skip (reason ):
5574 if Version (pytest .__version__ ) >= '3.3.0' :
5675 pytest .skip (reason , allow_module_level = True )
You can’t perform that action at this time.
0 commit comments