Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Module « flask.testing »

Classe « CliRunner »

Informations générales

Héritage

builtins.object
    CliRunner

Définition

class CliRunner(builtins.object):

Description [extrait de CliRunner.__doc__]

The CLI runner provides functionality to invoke a Click command line
    script for unittesting purposes in a isolated environment.  This only
    works in single-threaded systems without any concurrency as it changes the
    global interpreter state.

    :param charset: the character set for the input and output data.
    :param env: a dictionary with environment variables for overriding.
    :param echo_stdin: if this is set to `True`, then reading from stdin writes
                       to stdout.  This is useful for showing examples in
                       some circumstances.  Note that regular prompts
                       will automatically echo the input.
    :param mix_stderr: if this is set to `False`, then stdout and stderr are
                       preserved as independent streams.  This is useful for
                       Unix-philosophy apps that have predictable stdout and
                       noisy stderr, such that each may be measured
                       independently
    

Constructeur(s)

Signature du constructeur Description
__init__(self, charset: str = 'utf-8', env: Optional[Mapping[str, Optional[str]]] = None, echo_stdin: bool = False, mix_stderr: bool = True) -> None

Liste des opérateurs

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
get_default_prog_name(self, cli: 'BaseCommand') -> str Given a command object it will return the default program name [extrait de get_default_prog_name.__doc__]
invoke(self, cli: 'BaseCommand', args: Union[Sequence[str], str, NoneType] = None, input: Union[str, bytes, IO, NoneType] = None, env: Optional[Mapping[str, Optional[str]]] = None, catch_exceptions: bool = True, color: bool = False, **extra: Any) -> click.testing.Result Invokes a command in an isolated environment. The arguments are [extrait de invoke.__doc__]
isolated_filesystem(self, temp_dir: Union[str, os.PathLike, NoneType] = None) -> Iterator[str] A context manager that creates a temporary directory and [extrait de isolated_filesystem.__doc__]
isolation(self, input: Union[str, bytes, IO, NoneType] = None, env: Optional[Mapping[str, Optional[str]]] = None, color: bool = False) -> Iterator[Tuple[_io.BytesIO, Optional[_io.BytesIO]]] A context manager that sets up the isolation for invoking of a [extrait de isolation.__doc__]
make_env(self, overrides: Optional[Mapping[str, Optional[str]]] = None) -> Mapping[str, Optional[str]] Returns the environment overrides for invoking a script. [extrait de make_env.__doc__]

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __hash__, __init_subclass__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__