VOOZH about

URL: https://pypi.org/project/pytest-click/

โ‡ฑ pytest-click ยท PyPI


Skip to main content

pytest-click 1.1.0

pip install pytest-click

Latest release

Released:

Pytest plugin for Click

Navigation

Verified details

These details have been verified by PyPI
Maintainers
๐Ÿ‘ Avatar for Stranger6667 from gravatar.com
Stranger6667

Unverified details

These details have not been verified by PyPI
Project links
Meta

Project description

๐Ÿ‘ Build
๐Ÿ‘ Coverage
๐Ÿ‘ Version
๐Ÿ‘ Python versions
๐Ÿ‘ License

pytest plugin for Click.

Installation

The current stable release:

pip install pytest_click

Usage

`pytest-click comes with some configurable fixtures - cli_runner and isolated_cli_runner.

import clickdef test_cli(cli_runner): @click.command() @click.argument("name") def hello(name): click.echo("Hello %s!" % name) result = cli_runner.invoke(hello, ["Peter"]) assert result.exit_code == 0 assert result.output == "Hello Peter!\n"
import clickdef test_fixture(isolated_cli_runner): @click.command() @click.argument("f", type=click.File()) def cat(f): click.echo(f.read()) with open("hello.txt", "w") as f: f.write("Hello World!") result = isolated_cli_runner.invoke(cat, ["hello.txt"]) assert result.exit_code == 0 assert result.output == "Hello World!\n"

Both runners can be configured via runner_setup mark:

import pytest@pytest.mark.runner_setup(charset="cp1251", env={"test": 1}, echo_stdin=True)def test_runner_setup(cli_runner): ...

All kwargs will be passed to click.testing.CliRunner initialization.

Project details

Verified details

These details have been verified by PyPI
Maintainers
๐Ÿ‘ Avatar for Stranger6667 from gravatar.com
Stranger6667

Unverified details

These details have not been verified by PyPI
Project links
Meta

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_click-1.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

Filter files by name, interpreter, ABI, and platform.

If you're not sure about the file name format, learn more about wheel file names.

Copy a direct link to the current filters

pytest_click-1.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file pytest_click-1.1.0.tar.gz.

File metadata

  • Download URL: pytest_click-1.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pytest_click-1.1.0.tar.gz
Algorithm Hash digest
SHA256 fdd9f6721f877dda021e7c5dc73e70aecd37e5ed23ec6820f8a7b3fd7b4f8d30
MD5 a38c6127bf1ea60615da1c6eca575814
BLAKE2b-256 ececbca3cd29ba2b025ae41666b851f6ff05fb77cb4c13719baaeda6a757772a

See more details on using hashes here.

File details

Details for the file pytest_click-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_click-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pytest_click-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eade4742c2f02c345e78a32534a43e8db04acf98d415090539dacc880b7cd0e9
MD5 68de396f2d033beabffe2732b4b45d20
BLAKE2b-256 721aeb53371999b94b3c995c00117f3a232dbf6f56c7152a52cf3e3777e7d49d

See more details on using hashes here.

Supported by

๐Ÿ‘ Image
AWS Cloud computing and Security Sponsor ๐Ÿ‘ Image
Datadog Monitoring ๐Ÿ‘ Image
Depot Continuous Integration ๐Ÿ‘ Image
Fastly CDN ๐Ÿ‘ Image
Google Download Analytics ๐Ÿ‘ Image
Pingdom Monitoring ๐Ÿ‘ Image
Sentry Error logging ๐Ÿ‘ Image
StatusPage Status page