pytest-click 1.0.2__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. pytest_click-2.0.0/.gitignore +48 -0
  2. pytest_click-2.0.0/LICENSE +21 -0
  3. pytest_click-2.0.0/PKG-INFO +102 -0
  4. pytest_click-2.0.0/README.md +66 -0
  5. pytest_click-2.0.0/pyproject.toml +107 -0
  6. {pytest_click-1.0.2 → pytest_click-2.0.0}/src/pytest_click/__init__.py +6 -1
  7. {pytest_click-1.0.2 → pytest_click-2.0.0}/src/pytest_click/fixtures.py +4 -3
  8. pytest_click-2.0.0/src/pytest_click/py.typed +0 -0
  9. pytest_click-2.0.0/test/__init__.py +0 -0
  10. {pytest_click-1.0.2 → pytest_click-2.0.0}/test/conftest.py +0 -3
  11. pytest_click-2.0.0/test/fixtures/__init__.py +0 -0
  12. {pytest_click-1.0.2 → pytest_click-2.0.0}/test/fixtures/test_cli_runner.py +11 -14
  13. {pytest_click-1.0.2 → pytest_click-2.0.0}/test/fixtures/test_isolated_cli_runner.py +10 -16
  14. {pytest_click-1.0.2 → pytest_click-2.0.0}/test/test_plugin.py +3 -7
  15. pytest_click-1.0.2/CHANGELOG.md +0 -39
  16. pytest_click-1.0.2/MANIFEST.in +0 -6
  17. pytest_click-1.0.2/PKG-INFO +0 -105
  18. pytest_click-1.0.2/README.rst +0 -78
  19. pytest_click-1.0.2/pyproject.toml +0 -3
  20. pytest_click-1.0.2/setup.cfg +0 -4
  21. pytest_click-1.0.2/setup.py +0 -52
  22. pytest_click-1.0.2/src/pytest_click.egg-info/PKG-INFO +0 -105
  23. pytest_click-1.0.2/src/pytest_click.egg-info/SOURCES.txt +0 -19
  24. pytest_click-1.0.2/src/pytest_click.egg-info/dependency_links.txt +0 -1
  25. pytest_click-1.0.2/src/pytest_click.egg-info/entry_points.txt +0 -3
  26. pytest_click-1.0.2/src/pytest_click.egg-info/requires.txt +0 -2
  27. pytest_click-1.0.2/src/pytest_click.egg-info/top_level.txt +0 -1
  28. pytest_click-1.0.2/test/__init__.py +0 -1
  29. pytest_click-1.0.2/test/fixtures/__init__.py +0 -1
@@ -0,0 +1,48 @@
1
+ *.py[cod]
2
+
3
+ # C extensions
4
+ *.so
5
+
6
+ # Packages
7
+ *.egg
8
+ *.egg-info
9
+ .eggs
10
+ dist
11
+ build
12
+ eggs
13
+ parts
14
+ bin
15
+ var
16
+ sdist
17
+ develop-eggs
18
+ .installed.cfg
19
+ lib
20
+ lib64
21
+ venv*/
22
+ pyvenv*/
23
+
24
+ # Installer logs
25
+ pip-log.txt
26
+
27
+ # Unit test / coverage reports
28
+ .coverage
29
+ coverage.xml
30
+ junit.xml
31
+ .tox
32
+ .coverage.*
33
+ htmlcov
34
+
35
+ # Translations
36
+ *.mo
37
+
38
+ .idea
39
+
40
+ .DS_Store
41
+ *~
42
+ .*.sw[po]
43
+ .build
44
+ .ve
45
+ .env
46
+ .bootstrap
47
+ *.bak
48
+ .cache
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016-2020 Dmitry Dygalo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,102 @@
1
+ Metadata-Version: 2.5
2
+ Name: pytest_click
3
+ Version: 2.0.0
4
+ Summary: Pytest plugin for Click
5
+ Project-URL: Changelog, https://github.com/Stranger6667/pytest-click/blob/master/CHANGELOG.md
6
+ Project-URL: Bug Tracker, https://github.com/Stranger6667/pytest-click/issues
7
+ Project-URL: Funding, https://github.com/sponsors/Stranger6667
8
+ Project-URL: Source Code, https://github.com/Stranger6667/pytest-click
9
+ Author-email: Dmitry Dygalo <dmitry@dygalo.dev>
10
+ Maintainer-email: Dmitry Dygalo <dmitry@dygalo.dev>
11
+ License-Expression: MIT
12
+ License-File: LICENSE
13
+ Keywords: cli,click,pytest,testing
14
+ Classifier: Development Status :: 5 - Production/Stable
15
+ Classifier: Environment :: Console
16
+ Classifier: Framework :: Pytest
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3 :: Only
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
24
+ Classifier: Programming Language :: Python :: 3.15
25
+ Classifier: Programming Language :: Python :: Implementation :: CPython
26
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
27
+ Classifier: Topic :: Software Development :: Testing
28
+ Classifier: Typing :: Typed
29
+ Requires-Python: >=3.11
30
+ Requires-Dist: click>=6.0
31
+ Requires-Dist: pytest>=7.0
32
+ Provides-Extra: tests
33
+ Requires-Dist: coverage[toml]>=7.2; extra == 'tests'
34
+ Requires-Dist: pytest>=8; extra == 'tests'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # pytest-click
38
+
39
+ [![Build](https://github.com/Stranger6667/pytest-click/actions/workflows/build.yml/badge.svg)](https://github.com/Stranger6667/pytest-click/actions/workflows/build.yml)
40
+ [![Coverage](https://codecov.io/github/Stranger6667/pytest-click/coverage.svg?branch=master)](https://codecov.io/github/Stranger6667/pytest-click?branch=master)
41
+ [![Version](https://img.shields.io/pypi/v/pytest-click.svg)](https://pypi.org/project/pytest-click/)
42
+ [![Python versions](https://img.shields.io/pypi/pyversions/pytest-click.svg)](https://pypi.org/project/pytest-click/)
43
+ [![License](https://img.shields.io/pypi/l/pytest-click.svg)](https://opensource.org/licenses/MIT)
44
+
45
+ [pytest](https://github.com/pytest-dev/pytest) plugin for [Click](https://click.palletsprojects.com/).
46
+
47
+ ## Installation
48
+
49
+ ```
50
+ pip install pytest-click
51
+ ```
52
+
53
+ ## Usage
54
+
55
+ `pytest-click` comes with two fixtures: `cli_runner` and `isolated_cli_runner`.
56
+
57
+ ```python
58
+ import click
59
+
60
+
61
+ def test_cli(cli_runner):
62
+ @click.command()
63
+ @click.argument("name")
64
+ def hello(name):
65
+ click.echo(f"Hello {name}!")
66
+
67
+ result = cli_runner.invoke(hello, ["Peter"])
68
+ assert result.exit_code == 0
69
+ assert result.output == "Hello Peter!\n"
70
+ ```
71
+
72
+ `isolated_cli_runner` runs each test inside `CliRunner.isolated_filesystem()`:
73
+
74
+ ```python
75
+ import click
76
+
77
+
78
+ def test_fixture(isolated_cli_runner):
79
+ @click.command()
80
+ @click.argument("f", type=click.File())
81
+ def cat(f):
82
+ click.echo(f.read())
83
+
84
+ with open("hello.txt", "w") as f:
85
+ f.write("Hello World!")
86
+
87
+ result = isolated_cli_runner.invoke(cat, ["hello.txt"])
88
+ assert result.exit_code == 0
89
+ assert result.output == "Hello World!\n"
90
+ ```
91
+
92
+ Both runners can be configured with the `runner_setup` mark:
93
+
94
+ ```python
95
+ import pytest
96
+
97
+
98
+ @pytest.mark.runner_setup(charset="cp1251", env={"test": 1}, echo_stdin=True)
99
+ def test_runner_setup(cli_runner): ...
100
+ ```
101
+
102
+ All kwargs are passed to `click.testing.CliRunner`.
@@ -0,0 +1,66 @@
1
+ # pytest-click
2
+
3
+ [![Build](https://github.com/Stranger6667/pytest-click/actions/workflows/build.yml/badge.svg)](https://github.com/Stranger6667/pytest-click/actions/workflows/build.yml)
4
+ [![Coverage](https://codecov.io/github/Stranger6667/pytest-click/coverage.svg?branch=master)](https://codecov.io/github/Stranger6667/pytest-click?branch=master)
5
+ [![Version](https://img.shields.io/pypi/v/pytest-click.svg)](https://pypi.org/project/pytest-click/)
6
+ [![Python versions](https://img.shields.io/pypi/pyversions/pytest-click.svg)](https://pypi.org/project/pytest-click/)
7
+ [![License](https://img.shields.io/pypi/l/pytest-click.svg)](https://opensource.org/licenses/MIT)
8
+
9
+ [pytest](https://github.com/pytest-dev/pytest) plugin for [Click](https://click.palletsprojects.com/).
10
+
11
+ ## Installation
12
+
13
+ ```
14
+ pip install pytest-click
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ `pytest-click` comes with two fixtures: `cli_runner` and `isolated_cli_runner`.
20
+
21
+ ```python
22
+ import click
23
+
24
+
25
+ def test_cli(cli_runner):
26
+ @click.command()
27
+ @click.argument("name")
28
+ def hello(name):
29
+ click.echo(f"Hello {name}!")
30
+
31
+ result = cli_runner.invoke(hello, ["Peter"])
32
+ assert result.exit_code == 0
33
+ assert result.output == "Hello Peter!\n"
34
+ ```
35
+
36
+ `isolated_cli_runner` runs each test inside `CliRunner.isolated_filesystem()`:
37
+
38
+ ```python
39
+ import click
40
+
41
+
42
+ def test_fixture(isolated_cli_runner):
43
+ @click.command()
44
+ @click.argument("f", type=click.File())
45
+ def cat(f):
46
+ click.echo(f.read())
47
+
48
+ with open("hello.txt", "w") as f:
49
+ f.write("Hello World!")
50
+
51
+ result = isolated_cli_runner.invoke(cat, ["hello.txt"])
52
+ assert result.exit_code == 0
53
+ assert result.output == "Hello World!\n"
54
+ ```
55
+
56
+ Both runners can be configured with the `runner_setup` mark:
57
+
58
+ ```python
59
+ import pytest
60
+
61
+
62
+ @pytest.mark.runner_setup(charset="cp1251", env={"test": 1}, echo_stdin=True)
63
+ def test_runner_setup(cli_runner): ...
64
+ ```
65
+
66
+ All kwargs are passed to `click.testing.CliRunner`.
@@ -0,0 +1,107 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "pytest_click"
7
+ dynamic = ["version"]
8
+ description = "Pytest plugin for Click"
9
+ keywords = ["pytest", "click", "cli", "testing"]
10
+ authors = [{ name = "Dmitry Dygalo", email = "dmitry@dygalo.dev" }]
11
+ maintainers = [{ name = "Dmitry Dygalo", email = "dmitry@dygalo.dev" }]
12
+ readme = "README.md"
13
+ license = "MIT"
14
+ requires-python = ">=3.11"
15
+ classifiers = [
16
+ "Development Status :: 5 - Production/Stable",
17
+ "Environment :: Console",
18
+ "Framework :: Pytest",
19
+ "Intended Audience :: Developers",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3 :: Only",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Programming Language :: Python :: 3.14",
26
+ "Programming Language :: Python :: 3.15",
27
+ "Programming Language :: Python :: Implementation :: CPython",
28
+ "Programming Language :: Python :: Implementation :: PyPy",
29
+ "Topic :: Software Development :: Testing",
30
+ "Typing :: Typed",
31
+ ]
32
+ dependencies = ["click>=6.0", "pytest>=7.0"]
33
+
34
+ [project.optional-dependencies]
35
+ tests = ["coverage[toml]>=7.2", "pytest>=8"]
36
+
37
+ [project.entry-points.pytest11]
38
+ pytest_click = "pytest_click"
39
+
40
+ [project.urls]
41
+ Changelog = "https://github.com/Stranger6667/pytest-click/blob/master/CHANGELOG.md"
42
+ "Bug Tracker" = "https://github.com/Stranger6667/pytest-click/issues"
43
+ Funding = "https://github.com/sponsors/Stranger6667"
44
+ "Source Code" = "https://github.com/Stranger6667/pytest-click"
45
+
46
+ [tool.hatch.version]
47
+ path = "src/pytest_click/__init__.py"
48
+
49
+ [tool.hatch.build.targets.sdist]
50
+ include = ["/src", "/test"]
51
+
52
+ [tool.pytest.ini_options]
53
+ addopts = ["-ra", "--strict-markers", "--strict-config"]
54
+ xfail_strict = true
55
+ testpaths = ["test"]
56
+
57
+ [tool.coverage.run]
58
+ parallel = true
59
+ branch = true
60
+ source_pkgs = ["pytest_click"]
61
+
62
+ [tool.coverage.paths]
63
+ source = ["src", ".tox/*/site-packages", ".tox/*/lib/*/site-packages", ".tox/*/Lib/site-packages"]
64
+
65
+ [tool.coverage.report]
66
+ show_missing = true
67
+ precision = 2
68
+ fail_under = 100
69
+
70
+ [tool.ruff]
71
+ line-length = 120
72
+ target-version = "py311"
73
+
74
+ [tool.ruff.lint]
75
+ select = [
76
+ "E", # pycodestyle errors
77
+ "W", # pycodestyle warnings
78
+ "F", # pyflakes
79
+ "C", # flake8-comprehensions
80
+ "B", # flake8-bugbear
81
+ "D", # pydocstyle
82
+ "T201", # flake8-print
83
+ "I", # isort
84
+ "FURB", # refurb
85
+ "PGH003", # blanket-type-ignore
86
+ "UP", # pyupgrade
87
+ "SIM", # flake8-simplify
88
+ ]
89
+ ignore = [
90
+ "E501", # Line too long
91
+ "D100", # Missing docstring in public module
92
+ "D101", # Missing docstring in public class
93
+ "D102", # Missing docstring in public method
94
+ "D103", # Missing docstring in public function
95
+ "D104", # Missing docstring in public package
96
+ "D105", # Missing docstring in magic method
97
+ "D106", # Missing docstring in public nested class
98
+ "D107", # Missing docstring in `__init__`
99
+ "D202", # No blank lines allowed after function docstring
100
+ "D203", # One blank line before class
101
+ "D213", # Multiline summary second line
102
+ "D401", # Imperative mood
103
+ "D407", # Missing dashed underline after section
104
+ ]
105
+
106
+ [tool.ruff.lint.isort]
107
+ known-first-party = ["pytest_click"]
@@ -1,7 +1,12 @@
1
+ import pytest
2
+
1
3
  from .fixtures import cli_runner, isolated_cli_runner
2
4
 
5
+ __all__ = ["cli_runner", "isolated_cli_runner"]
6
+ __version__ = "2.0.0"
7
+
3
8
 
4
- def pytest_configure(config):
9
+ def pytest_configure(config: pytest.Config) -> None:
5
10
  config.addinivalue_line(
6
11
  "markers",
7
12
  "runner_setup(**kwargs): Pass kwargs to `click.testing.CliRunner` initialization.",
@@ -1,10 +1,11 @@
1
- # pylint: disable=redefined-outer-name
1
+ from collections.abc import Generator
2
+
2
3
  import pytest
3
4
  from click.testing import CliRunner
4
5
 
5
6
 
6
7
  @pytest.fixture
7
- def cli_runner(request):
8
+ def cli_runner(request: pytest.FixtureRequest) -> CliRunner:
8
9
  """Instance of `click.testing.CliRunner`. Can be configured with `@pytest.mark.runner_setup`.
9
10
 
10
11
  @pytest.mark.runner_setup(charset="cp1251")
@@ -19,7 +20,7 @@ def cli_runner(request):
19
20
 
20
21
 
21
22
  @pytest.fixture
22
- def isolated_cli_runner(cli_runner):
23
+ def isolated_cli_runner(cli_runner: CliRunner) -> Generator[CliRunner, None, None]:
23
24
  """Instance of `click.testing.CliRunner` with automagically `isolated_filesystem()` called."""
24
25
  with cli_runner.isolated_filesystem():
25
26
  yield cli_runner
File without changes
File without changes
@@ -1,4 +1 @@
1
- # coding: utf-8
2
-
3
-
4
1
  pytest_plugins = "pytester"
File without changes
@@ -1,8 +1,5 @@
1
- # coding: utf-8
2
-
3
-
4
- def test_fixture(testdir):
5
- testdir.makepyfile(
1
+ def test_fixture(pytester):
2
+ pytester.makepyfile(
6
3
  """
7
4
  from click.testing import CliRunner
8
5
 
@@ -10,12 +7,12 @@ def test_fixture(testdir):
10
7
  assert isinstance(cli_runner, CliRunner)
11
8
  """
12
9
  )
13
- result = testdir.runpytest("--verbose")
10
+ result = pytester.runpytest("--verbose")
14
11
  result.stdout.fnmatch_lines("test_fixture.py::test_fixture PASSED*")
15
12
 
16
13
 
17
- def test_real_invocation(testdir):
18
- testdir.makepyfile(
14
+ def test_real_invocation(pytester):
15
+ pytester.makepyfile(
19
16
  """
20
17
  import click
21
18
 
@@ -31,12 +28,12 @@ def test_real_invocation(testdir):
31
28
  assert result.output == 'Hello Peter!\\n'
32
29
  """
33
30
  )
34
- result = testdir.runpytest("--verbose")
31
+ result = pytester.runpytest("--verbose")
35
32
  result.stdout.fnmatch_lines("test_real_invocation.py::test_fixture PASSED*")
36
33
 
37
34
 
38
- def test_runner_setup(testdir):
39
- testdir.makepyfile(
35
+ def test_runner_setup(pytester):
36
+ pytester.makepyfile(
40
37
  """
41
38
  import pytest
42
39
 
@@ -47,12 +44,12 @@ def test_runner_setup(testdir):
47
44
  assert cli_runner.echo_stdin
48
45
  """
49
46
  )
50
- result = testdir.runpytest("--verbose")
47
+ result = pytester.runpytest("--verbose")
51
48
  result.stdout.fnmatch_lines("test_runner_setup.py::test_runner_setup PASSED*")
52
49
 
53
50
 
54
- def test_docstring(testdir):
55
- result = testdir.runpytest("--fixtures")
51
+ def test_docstring(pytester):
52
+ result = pytester.runpytest("--fixtures")
56
53
  assert (
57
54
  " Instance of `click.testing.CliRunner`. Can be "
58
55
  "configured with `@pytest.mark.runner_setup`." in result.stdout.lines
@@ -1,13 +1,7 @@
1
- # coding: utf-8
2
-
3
-
4
- def test_fixture(testdir):
5
- testdir.makeconftest(
1
+ def test_fixture(pytester):
2
+ pytester.makeconftest(
6
3
  """
7
- try:
8
- from mock import patch, Mock
9
- except ImportError:
10
- from unittest.mock import patch, Mock
4
+ from unittest.mock import patch
11
5
 
12
6
  def pytest_configure(config):
13
7
  config.patched = patch('pytest_click.fixtures.CliRunner.isolated_filesystem')
@@ -17,7 +11,7 @@ def test_fixture(testdir):
17
11
  config.patched.stop()
18
12
  """
19
13
  )
20
- testdir.makepyfile(
14
+ pytester.makepyfile(
21
15
  """
22
16
  from click.testing import CliRunner
23
17
 
@@ -26,12 +20,12 @@ def test_fixture(testdir):
26
20
  assert isolated_cli_runner.isolated_filesystem.called
27
21
  """
28
22
  )
29
- result = testdir.runpytest("--verbose")
23
+ result = pytester.runpytest("--verbose")
30
24
  result.stdout.fnmatch_lines("test_fixture.py::test_fixture PASSED*")
31
25
 
32
26
 
33
- def test_real_invocation(testdir):
34
- testdir.makepyfile(
27
+ def test_real_invocation(pytester):
28
+ pytester.makepyfile(
35
29
  """
36
30
  import click
37
31
 
@@ -50,12 +44,12 @@ def test_real_invocation(testdir):
50
44
  assert result.output == 'Hello World!\\n'
51
45
  """
52
46
  )
53
- result = testdir.runpytest("--verbose")
47
+ result = pytester.runpytest("--verbose")
54
48
  result.stdout.fnmatch_lines("test_real_invocation.py::test_fixture PASSED*")
55
49
 
56
50
 
57
- def test_docstring(testdir):
58
- result = testdir.runpytest("--fixtures")
51
+ def test_docstring(pytester):
52
+ result = pytester.runpytest("--fixtures")
59
53
  assert (
60
54
  " Instance of `click.testing.CliRunner` with "
61
55
  "automagically `isolated_filesystem()` called." in result.stdout.lines
@@ -1,10 +1,6 @@
1
- # coding: utf-8
2
-
3
-
4
- def test_markers(testdir):
5
- result = testdir.runpytest("--markers")
1
+ def test_markers(pytester):
2
+ result = pytester.runpytest("--markers")
6
3
  assert (
7
4
  "@pytest.mark.runner_setup(**kwargs): "
8
- "Pass kwargs to `click.testing.CliRunner` initialization."
9
- in result.stdout.lines
5
+ "Pass kwargs to `click.testing.CliRunner` initialization." in result.stdout.lines
10
6
  )
@@ -1,39 +0,0 @@
1
- History
2
- -------
3
-
4
- 1.0.2 - 29.08.2020
5
- ----------------
6
-
7
- - Format code examples with "black".
8
-
9
- 1.0.1 - 29.08.2020
10
- ----------------
11
-
12
- - Include "test" to the package itself.
13
-
14
- 1.0.0 - 29.08.2020
15
- ----------------
16
-
17
- - Added builds for Python 3.8 & 3.9
18
- - Drop support for Python 2.7 & 3.4
19
-
20
- 0.3.1 - 28.08.2020
21
- ----------------
22
-
23
- - Move to `src` layout
24
-
25
- 0.3 - 05.01.2019
26
- ----------------
27
-
28
- * Added Python 3.7 support
29
- * Dropped support for Python 2.6, 3.3 and Jython
30
-
31
- 0.2 - 13.04.2017
32
- ----------------
33
-
34
- * Added Python 3.6 support
35
-
36
- 0.1 - 29.01.2016
37
- ----------------
38
-
39
- * Initial release.
@@ -1,6 +0,0 @@
1
- include CHANGELOG.md
2
- include README.rst
3
-
4
- recursive-include test *
5
- recursive-exclude * __pycache__
6
- recursive-exclude * *.py[co]
@@ -1,105 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: pytest_click
3
- Version: 1.0.2
4
- Summary: Py.test plugin for Click
5
- Home-page: https://github.com/Stranger6667/pytest-click
6
- Author: Dmitry Dygalo
7
- Author-email: dadygalo@gmail.com
8
- Maintainer: Dmitry Dygalo
9
- Maintainer-email: dadygalo@gmail.com
10
- License: MIT
11
- Description: pytest-click
12
- ============
13
- Py.test plugin for `Click <http://click.pocoo.org/>`_.
14
-
15
- |Build| |Coverage| |Version| |Python versions| |License|
16
-
17
-
18
- Installation
19
- ------------
20
-
21
- The current stable release:
22
-
23
- ::
24
-
25
- pip install pytest_click
26
-
27
- Usage
28
- -----
29
-
30
- pytest-click comes with some configurable fixtures - ``cli_runner`` and ``isolated_cli_runner``.
31
-
32
- .. code:: python
33
-
34
- import click
35
-
36
-
37
- def test_cli(cli_runner):
38
- @click.command()
39
- @click.argument("name")
40
- def hello(name):
41
- click.echo("Hello %s!" % name)
42
-
43
- result = cli_runner.invoke(hello, ["Peter"])
44
- assert result.exit_code == 0
45
- assert result.output == "Hello Peter!\n"
46
-
47
- .. code:: python
48
-
49
- import click
50
-
51
-
52
- def test_fixture(isolated_cli_runner):
53
- @click.command()
54
- @click.argument("f", type=click.File())
55
- def cat(f):
56
- click.echo(f.read())
57
-
58
- with open("hello.txt", "w") as f:
59
- f.write("Hello World!")
60
-
61
- result = isolated_cli_runner.invoke(cat, ["hello.txt"])
62
- assert result.exit_code == 0
63
- assert result.output == "Hello World!\n"
64
-
65
- Both runners can be configured via ``runner_setup`` mark:
66
-
67
- .. code:: python
68
-
69
- import pytest
70
-
71
-
72
- @pytest.mark.runner_setup(charset="cp1251", env={"test": 1}, echo_stdin=True)
73
- def test_runner_setup(cli_runner):
74
- ...
75
-
76
- All kwargs will be passed to ``click.testing.CliRunner`` initialization.
77
-
78
-
79
- .. |Build| image:: image:: https://github.com/Stranger6667/pytest-click/workflows/build/badge.svg
80
- :target: https://github.com/Stranger6667/pytest-click/actions
81
- .. |Coverage| image:: https://codecov.io/github/Stranger6667/pytest-click/coverage.svg?branch=master
82
- :target: https://codecov.io/github/Stranger6667/pytest-click?branch=master
83
- .. |Version| image:: https://img.shields.io/pypi/v/pytest-click.svg
84
- :target: https://pypi.org/project/pytest-click/
85
- .. |Python versions| image:: https://img.shields.io/pypi/pyversions/pytest-click.svg
86
- :target: https://pypi.org/project/pytest-click/
87
- .. |License| image:: https://img.shields.io/pypi/l/pytest-click.svg
88
- :target: https://opensource.org/licenses/MIT
89
-
90
- Platform: UNKNOWN
91
- Classifier: Development Status :: 5 - Production/Stable
92
- Classifier: Environment :: Console
93
- Classifier: Intended Audience :: Developers
94
- Classifier: Operating System :: OS Independent
95
- Classifier: License :: OSI Approved :: MIT License
96
- Classifier: Programming Language :: Python
97
- Classifier: Programming Language :: Python :: 3.5
98
- Classifier: Programming Language :: Python :: 3.6
99
- Classifier: Programming Language :: Python :: 3.7
100
- Classifier: Programming Language :: Python :: 3.8
101
- Classifier: Programming Language :: Python :: 3.9
102
- Classifier: Programming Language :: Python :: Implementation :: CPython
103
- Classifier: Programming Language :: Python :: Implementation :: PyPy
104
- Classifier: Topic :: Software Development :: Testing
105
- Description-Content-Type: text/x-rst
@@ -1,78 +0,0 @@
1
- pytest-click
2
- ============
3
- Py.test plugin for `Click <http://click.pocoo.org/>`_.
4
-
5
- |Build| |Coverage| |Version| |Python versions| |License|
6
-
7
-
8
- Installation
9
- ------------
10
-
11
- The current stable release:
12
-
13
- ::
14
-
15
- pip install pytest_click
16
-
17
- Usage
18
- -----
19
-
20
- pytest-click comes with some configurable fixtures - ``cli_runner`` and ``isolated_cli_runner``.
21
-
22
- .. code:: python
23
-
24
- import click
25
-
26
-
27
- def test_cli(cli_runner):
28
- @click.command()
29
- @click.argument("name")
30
- def hello(name):
31
- click.echo("Hello %s!" % name)
32
-
33
- result = cli_runner.invoke(hello, ["Peter"])
34
- assert result.exit_code == 0
35
- assert result.output == "Hello Peter!\n"
36
-
37
- .. code:: python
38
-
39
- import click
40
-
41
-
42
- def test_fixture(isolated_cli_runner):
43
- @click.command()
44
- @click.argument("f", type=click.File())
45
- def cat(f):
46
- click.echo(f.read())
47
-
48
- with open("hello.txt", "w") as f:
49
- f.write("Hello World!")
50
-
51
- result = isolated_cli_runner.invoke(cat, ["hello.txt"])
52
- assert result.exit_code == 0
53
- assert result.output == "Hello World!\n"
54
-
55
- Both runners can be configured via ``runner_setup`` mark:
56
-
57
- .. code:: python
58
-
59
- import pytest
60
-
61
-
62
- @pytest.mark.runner_setup(charset="cp1251", env={"test": 1}, echo_stdin=True)
63
- def test_runner_setup(cli_runner):
64
- ...
65
-
66
- All kwargs will be passed to ``click.testing.CliRunner`` initialization.
67
-
68
-
69
- .. |Build| image:: image:: https://github.com/Stranger6667/pytest-click/workflows/build/badge.svg
70
- :target: https://github.com/Stranger6667/pytest-click/actions
71
- .. |Coverage| image:: https://codecov.io/github/Stranger6667/pytest-click/coverage.svg?branch=master
72
- :target: https://codecov.io/github/Stranger6667/pytest-click?branch=master
73
- .. |Version| image:: https://img.shields.io/pypi/v/pytest-click.svg
74
- :target: https://pypi.org/project/pytest-click/
75
- .. |Python versions| image:: https://img.shields.io/pypi/pyversions/pytest-click.svg
76
- :target: https://pypi.org/project/pytest-click/
77
- .. |License| image:: https://img.shields.io/pypi/l/pytest-click.svg
78
- :target: https://opensource.org/licenses/MIT
@@ -1,3 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools >= 40.6.0", "wheel"]
3
- build-backend = "setuptools.build_meta"
@@ -1,4 +0,0 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env python
2
- from os import path
3
-
4
- from setuptools import find_packages, setup
5
-
6
- this_directory = path.abspath(path.dirname(__file__))
7
- with open(path.join(this_directory, "README.rst")) as fd:
8
- long_description = fd.read()
9
-
10
- requirements = [
11
- "click>=6.0",
12
- "pytest>=5.0",
13
- ]
14
-
15
- setup(
16
- name="pytest_click",
17
- version="1.0.2",
18
- url="https://github.com/Stranger6667/pytest-click",
19
- license="MIT",
20
- author="Dmitry Dygalo",
21
- author_email="dadygalo@gmail.com",
22
- maintainer="Dmitry Dygalo",
23
- maintainer_email="dadygalo@gmail.com",
24
- description="Py.test plugin for Click",
25
- long_description=long_description,
26
- long_description_content_type="text/x-rst",
27
- classifiers=[
28
- "Development Status :: 5 - Production/Stable",
29
- "Environment :: Console",
30
- "Intended Audience :: Developers",
31
- "Operating System :: OS Independent",
32
- "License :: OSI Approved :: MIT License",
33
- "Programming Language :: Python",
34
- "Programming Language :: Python :: 3.5",
35
- "Programming Language :: Python :: 3.6",
36
- "Programming Language :: Python :: 3.7",
37
- "Programming Language :: Python :: 3.8",
38
- "Programming Language :: Python :: 3.9",
39
- "Programming Language :: Python :: Implementation :: CPython",
40
- "Programming Language :: Python :: Implementation :: PyPy",
41
- "Topic :: Software Development :: Testing",
42
- ],
43
- include_package_data=True,
44
- packages=find_packages(where="src"),
45
- package_dir={"": "src"},
46
- install_requires=requirements,
47
- entry_points={
48
- "pytest11": [
49
- "pytest_click = pytest_click",
50
- ]
51
- },
52
- )
@@ -1,105 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: pytest-click
3
- Version: 1.0.2
4
- Summary: Py.test plugin for Click
5
- Home-page: https://github.com/Stranger6667/pytest-click
6
- Author: Dmitry Dygalo
7
- Author-email: dadygalo@gmail.com
8
- Maintainer: Dmitry Dygalo
9
- Maintainer-email: dadygalo@gmail.com
10
- License: MIT
11
- Description: pytest-click
12
- ============
13
- Py.test plugin for `Click <http://click.pocoo.org/>`_.
14
-
15
- |Build| |Coverage| |Version| |Python versions| |License|
16
-
17
-
18
- Installation
19
- ------------
20
-
21
- The current stable release:
22
-
23
- ::
24
-
25
- pip install pytest_click
26
-
27
- Usage
28
- -----
29
-
30
- pytest-click comes with some configurable fixtures - ``cli_runner`` and ``isolated_cli_runner``.
31
-
32
- .. code:: python
33
-
34
- import click
35
-
36
-
37
- def test_cli(cli_runner):
38
- @click.command()
39
- @click.argument("name")
40
- def hello(name):
41
- click.echo("Hello %s!" % name)
42
-
43
- result = cli_runner.invoke(hello, ["Peter"])
44
- assert result.exit_code == 0
45
- assert result.output == "Hello Peter!\n"
46
-
47
- .. code:: python
48
-
49
- import click
50
-
51
-
52
- def test_fixture(isolated_cli_runner):
53
- @click.command()
54
- @click.argument("f", type=click.File())
55
- def cat(f):
56
- click.echo(f.read())
57
-
58
- with open("hello.txt", "w") as f:
59
- f.write("Hello World!")
60
-
61
- result = isolated_cli_runner.invoke(cat, ["hello.txt"])
62
- assert result.exit_code == 0
63
- assert result.output == "Hello World!\n"
64
-
65
- Both runners can be configured via ``runner_setup`` mark:
66
-
67
- .. code:: python
68
-
69
- import pytest
70
-
71
-
72
- @pytest.mark.runner_setup(charset="cp1251", env={"test": 1}, echo_stdin=True)
73
- def test_runner_setup(cli_runner):
74
- ...
75
-
76
- All kwargs will be passed to ``click.testing.CliRunner`` initialization.
77
-
78
-
79
- .. |Build| image:: image:: https://github.com/Stranger6667/pytest-click/workflows/build/badge.svg
80
- :target: https://github.com/Stranger6667/pytest-click/actions
81
- .. |Coverage| image:: https://codecov.io/github/Stranger6667/pytest-click/coverage.svg?branch=master
82
- :target: https://codecov.io/github/Stranger6667/pytest-click?branch=master
83
- .. |Version| image:: https://img.shields.io/pypi/v/pytest-click.svg
84
- :target: https://pypi.org/project/pytest-click/
85
- .. |Python versions| image:: https://img.shields.io/pypi/pyversions/pytest-click.svg
86
- :target: https://pypi.org/project/pytest-click/
87
- .. |License| image:: https://img.shields.io/pypi/l/pytest-click.svg
88
- :target: https://opensource.org/licenses/MIT
89
-
90
- Platform: UNKNOWN
91
- Classifier: Development Status :: 5 - Production/Stable
92
- Classifier: Environment :: Console
93
- Classifier: Intended Audience :: Developers
94
- Classifier: Operating System :: OS Independent
95
- Classifier: License :: OSI Approved :: MIT License
96
- Classifier: Programming Language :: Python
97
- Classifier: Programming Language :: Python :: 3.5
98
- Classifier: Programming Language :: Python :: 3.6
99
- Classifier: Programming Language :: Python :: 3.7
100
- Classifier: Programming Language :: Python :: 3.8
101
- Classifier: Programming Language :: Python :: 3.9
102
- Classifier: Programming Language :: Python :: Implementation :: CPython
103
- Classifier: Programming Language :: Python :: Implementation :: PyPy
104
- Classifier: Topic :: Software Development :: Testing
105
- Description-Content-Type: text/x-rst
@@ -1,19 +0,0 @@
1
- CHANGELOG.md
2
- MANIFEST.in
3
- README.rst
4
- pyproject.toml
5
- setup.py
6
- src/pytest_click/__init__.py
7
- src/pytest_click/fixtures.py
8
- src/pytest_click.egg-info/PKG-INFO
9
- src/pytest_click.egg-info/SOURCES.txt
10
- src/pytest_click.egg-info/dependency_links.txt
11
- src/pytest_click.egg-info/entry_points.txt
12
- src/pytest_click.egg-info/requires.txt
13
- src/pytest_click.egg-info/top_level.txt
14
- test/__init__.py
15
- test/conftest.py
16
- test/test_plugin.py
17
- test/fixtures/__init__.py
18
- test/fixtures/test_cli_runner.py
19
- test/fixtures/test_isolated_cli_runner.py
@@ -1,3 +0,0 @@
1
- [pytest11]
2
- pytest_click = pytest_click
3
-
@@ -1,2 +0,0 @@
1
- click>=6.0
2
- pytest>=5.0
@@ -1 +0,0 @@
1
- pytest_click
@@ -1 +0,0 @@
1
- # coding: utf-8
@@ -1 +0,0 @@
1
- # coding: utf-8