case.skip¶
-
case.skip.todo(reason)[source]¶ Skip test flagging case as TODO.
Example:
@skip.todo(reason='broken test')
-
case.skip.if_environ(env_var_name)[source]¶ Skip test if environment variable
env_var_nameis defined.Example:
@skip.if_environ('SKIP_SLOW_TESTS')
-
case.skip.unless_environ(env_var_name)[source]¶ Skip test if environment variable
env_var_nameis undefined.Example:
@skip.unless_environ('LOCALE')
-
case.skip.if_module(module, name=None, import_errors=(<class 'ImportError'>, ))[source]¶ Skip test if
modulecan be imported.Parameters: - module – Module to import.
- name – Alternative module name to use in reason.
- import_errors – Tuple of import errors to check for.
Default is
(ImportError,).
Example:
@skip.if_module('librabbitmq')
-
case.skip.unless_module(module, name=None, import_errors=(<class 'ImportError'>, ))[source]¶ Skip test if
modulecan not be imported.Parameters: - module – Module to import.
- name – Alternative module name to use in reason.
- import_errors – Tuple of import errors to check for.
Default is
(ImportError,).
Example:
@skip.unless_module('librabbitmq')
-
case.skip.if_platform(platform_name, name=None)[source]¶ Skip test if
sys.platformname matchesplatform_name.Parameters: - platform_name – Name to match with
sys.platform. - name – Alternative name to use in reason.
Example:
@skip.if_platform('netbsd', name='NetBSD')
- platform_name – Name to match with
-
case.skip.unless_platform(platform_name, name=None)[source]¶ Skip test if
sys.platformname does not matchplatform_name.Parameters: - platform_name – Name to match with
sys.platform. - name – Alternative name to use in reason.
Example:
@skip.unless_platform('netbsd', name='NetBSD')
- platform_name – Name to match with
-
case.skip.if_pypy(reason='does not work on PyPy')[source]¶ Skip test if running on PyPy.
Example:
@skip.if_pypy()
-
case.skip.unless_pypy(reason='only applicable for PyPy')[source]¶ Skip test if not running on PyPy.
Example:
@skip.unless_pypy()
-
case.skip.if_python3(*version, **kwargs)[source]¶ Skip test if Python version is 3 or later.
Example:
@skip.if_python3(reason='does not have buffer type')
-
case.skip.unless_python3(*version, **kwargs)[source]¶ Skip test if Python version is Python 2 or earlier.
Example:
@skip.unless_python3()
-
case.skip.if_symbol(symbol, name=None, import_errors=(<class 'AttributeError'>, <class 'ImportError'>))[source]¶ Skip test if
symbolcan be imported.Parameters: - module – Symbol to import.
- name – Alternative symbol name to use in reason.
- import_errors – Tuple of import errors to check for.
Default is
(AttributeError, ImportError,).
Example:
@skip.if_symbol('django.db.transaction:on_commit')
-
case.skip.unless_symbol(symbol, name=None, import_errors=(<class 'AttributeError'>, <class 'ImportError'>))[source]¶ Skip test if
symbolcannot be imported.Parameters: - module – Symbol to import.
- name – Alternative symbol name to use in reason.
- import_errors – Tuple of import errors to check for.
Default is
(AttributeError, ImportError,).
Example:
@skip.unless_symbol('django.db.transaction:on_commit')