Merge branch 'master' into support_literal_choices
This commit is contained in:
commit
7a3466d67f
167 changed files with 734 additions and 293 deletions
|
@ -6,3 +6,4 @@ source =
|
|||
docs_src
|
||||
|
||||
parallel = True
|
||||
context = '${CONTEXT}'
|
||||
|
|
10
.github/dependabot.yml
vendored
10
.github/dependabot.yml
vendored
|
@ -1,6 +1,16 @@
|
|||
version: 2
|
||||
updates:
|
||||
# GitHub Actions
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
commit-message:
|
||||
prefix: ⬆
|
||||
# Python
|
||||
- package-ecosystem: "pip"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
commit-message:
|
||||
prefix: ⬆
|
||||
|
|
14
.github/workflows/build-docs.yml
vendored
14
.github/workflows/build-docs.yml
vendored
|
@ -19,9 +19,9 @@ jobs:
|
|||
env:
|
||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||
run: echo "$GITHUB_CONTEXT"
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.7"
|
||||
# Allow debugging with tmate
|
||||
|
@ -30,7 +30,7 @@ jobs:
|
|||
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
|
||||
with:
|
||||
limit-access-to-actor: true
|
||||
- uses: actions/cache@v2
|
||||
- uses: actions/cache@v3
|
||||
id: cache
|
||||
with:
|
||||
path: ${{ env.pythonLocation }}
|
||||
|
@ -44,7 +44,7 @@ jobs:
|
|||
- name: Install Material for MkDocs Insiders
|
||||
if: ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false ) && steps.cache.outputs.cache-hit != 'true'
|
||||
run: python3.7 -m pip install git+https://${{ secrets.ACTIONS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
|
||||
- uses: actions/cache@v2
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
key: mkdocs-cards-${{ github.ref }}-v1
|
||||
path: .cache
|
||||
|
@ -56,12 +56,12 @@ jobs:
|
|||
run: python3.7 -m mkdocs build --config-file mkdocs.insiders.yml
|
||||
- name: Zip docs
|
||||
run: bash ./scripts/zip-docs.sh
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: docs-zip
|
||||
path: ./docs.zip
|
||||
path: ./site/docs.zip
|
||||
- name: Deploy to Netlify
|
||||
uses: nwtgck/actions-netlify@v1.1.5
|
||||
uses: nwtgck/actions-netlify@v2.0.0
|
||||
with:
|
||||
publish-dir: './site'
|
||||
production-branch: master
|
||||
|
|
2
.github/workflows/issue-manager.yml
vendored
2
.github/workflows/issue-manager.yml
vendored
|
@ -15,7 +15,7 @@ jobs:
|
|||
issue-manager:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: tiangolo/issue-manager@0.2.0
|
||||
- uses: tiangolo/issue-manager@0.4.0
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
config: >
|
||||
|
|
2
.github/workflows/latest-changes.yml
vendored
2
.github/workflows/latest-changes.yml
vendored
|
@ -20,7 +20,7 @@ jobs:
|
|||
latest-changes:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
# To allow latest-changes to commit to the main branch
|
||||
token: ${{ secrets.ACTIONS_TOKEN }}
|
||||
|
|
13
.github/workflows/preview-docs.yml
vendored
13
.github/workflows/preview-docs.yml
vendored
|
@ -10,22 +10,27 @@ jobs:
|
|||
preview-docs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Clean site
|
||||
run: |
|
||||
rm -rf ./site
|
||||
mkdir ./site
|
||||
- name: Download Artifact Docs
|
||||
uses: dawidd6/action-download-artifact@v2.9.0
|
||||
uses: dawidd6/action-download-artifact@v2.24.2
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
workflow: build-docs.yml
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
name: docs-zip
|
||||
path: ./site/
|
||||
- name: Unzip docs
|
||||
run: |
|
||||
rm -rf ./site
|
||||
cd ./site
|
||||
unzip docs.zip
|
||||
rm -f docs.zip
|
||||
- name: Deploy to Netlify
|
||||
id: netlify
|
||||
uses: nwtgck/actions-netlify@v1.1.5
|
||||
uses: nwtgck/actions-netlify@v2.0.0
|
||||
with:
|
||||
publish-dir: './site'
|
||||
production-deploy: false
|
||||
|
|
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
|
@ -9,9 +9,9 @@ jobs:
|
|||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.7"
|
||||
- name: Install Flit
|
||||
|
|
35
.github/workflows/smokeshow.yml
vendored
Normal file
35
.github/workflows/smokeshow.yml
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
name: Smokeshow
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [Test]
|
||||
types: [completed]
|
||||
|
||||
permissions:
|
||||
statuses: write
|
||||
|
||||
jobs:
|
||||
smokeshow:
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
- run: pip install smokeshow
|
||||
|
||||
- uses: dawidd6/action-download-artifact@v2.24.2
|
||||
with:
|
||||
workflow: test.yml
|
||||
commit: ${{ github.event.workflow_run.head_sha }}
|
||||
|
||||
- run: smokeshow upload coverage-html
|
||||
env:
|
||||
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
|
||||
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 100
|
||||
SMOKESHOW_GITHUB_CONTEXT: coverage
|
||||
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
|
||||
SMOKESHOW_AUTH_KEY: ${{ secrets.SMOKESHOW_AUTH_KEY }}
|
55
.github/workflows/test.yml
vendored
55
.github/workflows/test.yml
vendored
|
@ -9,30 +9,71 @@ on:
|
|||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.6, 3.7, 3.8, 3.9]
|
||||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
|
||||
click-7: [true, false]
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install Flit
|
||||
run: pip install flit
|
||||
- name: Install Dependencies
|
||||
run: flit install --deps=develop --symlink
|
||||
if: ${{ matrix.python-version != '3.6' }}
|
||||
run: python -m flit install --symlink
|
||||
- name: Install Dependencies
|
||||
if: ${{ matrix.python-version == '3.6' }}
|
||||
# This doesn't install the editable install, so coverage doesn't get subprocesses
|
||||
run: python -m pip install ".[test]"
|
||||
- name: Install Click 7
|
||||
if: matrix.click-7
|
||||
run: pip install "click<8.0.0"
|
||||
- name: Lint
|
||||
if: ${{ matrix.python-version != '3.6' && matrix.click-7 == false }}
|
||||
run: bash scripts/lint.sh
|
||||
- run: mkdir coverage
|
||||
- name: Test
|
||||
run: bash scripts/test.sh
|
||||
- name: Upload coverage
|
||||
uses: codecov/codecov-action@v3
|
||||
env:
|
||||
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-click-7-${{ matrix.click-7 }}
|
||||
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}-click-7-${{ matrix.click-7 }}
|
||||
- name: Store coverage files
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage
|
||||
coverage-combine:
|
||||
needs: [test]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
- name: Get coverage files
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage
|
||||
|
||||
- run: pip install coverage[toml]
|
||||
|
||||
- run: ls -la coverage
|
||||
- run: coverage combine coverage
|
||||
- run: coverage report
|
||||
- run: coverage html --show-contexts --title "Coverage for ${{ github.sha }}"
|
||||
|
||||
- name: Store coverage HTML
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage-html
|
||||
path: htmlcov
|
||||
|
|
|
@ -12,7 +12,7 @@ repos:
|
|||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v2.34.0
|
||||
rev: v3.2.2
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args:
|
||||
|
@ -20,8 +20,8 @@ repos:
|
|||
- --keep-runtime-typing
|
||||
# This file is more readable without yield from
|
||||
exclude: ^docs_src/progressbar/tutorial004\.py
|
||||
- repo: https://github.com/myint/autoflake
|
||||
rev: v1.4
|
||||
- repo: https://github.com/PyCQA/autoflake
|
||||
rev: v1.7.7
|
||||
hooks:
|
||||
- id: autoflake
|
||||
args:
|
||||
|
@ -45,7 +45,7 @@ repos:
|
|||
name: isort (pyi)
|
||||
types: [pyi]
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.3.0
|
||||
rev: 22.10.0
|
||||
hooks:
|
||||
- id: black
|
||||
ci:
|
||||
|
|
|
@ -11,9 +11,8 @@
|
|||
<a href="https://github.com/tiangolo/typer/actions?query=workflow%3APublish" target="_blank">
|
||||
<img src="https://github.com/tiangolo/typer/workflows/Publish/badge.svg" alt="Publish">
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/tiangolo/typer" target="_blank">
|
||||
<img src="https://img.shields.io/codecov/c/github/tiangolo/typer?color=%2334D058" alt="Coverage">
|
||||
</a>
|
||||
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/tiangolo/typer" target="_blank">
|
||||
<img src="https://coverage-badge.samuelcolvin.workers.dev/tiangolo/typer.svg" alt="Coverage">
|
||||
<a href="https://pypi.org/project/typer" target="_blank">
|
||||
<img src="https://img.shields.io/pypi/v/typer?color=%2334D058&label=pypi%20package" alt="Package version">
|
||||
</a>
|
||||
|
|
|
@ -26,7 +26,7 @@ It inspired a lot of the ideas in **FastAPI** and **Typer**.
|
|||
!!! check "Inspired **Typer** to"
|
||||
Use function parameters to declare *CLI arguments* and *CLI options* as it simplifies a lot the development experience.
|
||||
|
||||
### <a href="https://micheles.github.io/plac/" class="external-link" target="_blank">Plac</a>
|
||||
### <a href="https://plac.readthedocs.io/en/latest/" class="external-link" target="_blank">Plac</a>
|
||||
|
||||
Plac is another library to create CLIs using parameters in functions, similar to Hug.
|
||||
|
||||
|
|
|
@ -11,9 +11,8 @@
|
|||
<a href="https://github.com/tiangolo/typer/actions?query=workflow%3APublish" target="_blank">
|
||||
<img src="https://github.com/tiangolo/typer/workflows/Publish/badge.svg" alt="Publish">
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/tiangolo/typer" target="_blank">
|
||||
<img src="https://img.shields.io/codecov/c/github/tiangolo/typer?color=%2334D058" alt="Coverage">
|
||||
</a>
|
||||
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/tiangolo/typer" target="_blank">
|
||||
<img src="https://coverage-badge.samuelcolvin.workers.dev/tiangolo/typer.svg" alt="Coverage">
|
||||
<a href="https://pypi.org/project/typer" target="_blank">
|
||||
<img src="https://img.shields.io/pypi/v/typer?color=%2334D058&label=pypi%20package" alt="Package version">
|
||||
</a>
|
||||
|
|
|
@ -1,5 +1,51 @@
|
|||
## Latest Changes
|
||||
|
||||
* ⬆ Bump nwtgck/actions-netlify from 1.2.4 to 2.0.0. PR [#513](https://github.com/tiangolo/typer/pull/513) by [@dependabot[bot]](https://github.com/apps/dependabot).
|
||||
* 👷 Refactor CI artifact upload/download for docs previews. PR [#516](https://github.com/tiangolo/typer/pull/516) by [@tiangolo](https://github.com/tiangolo).
|
||||
* ⬆ [pre-commit.ci] pre-commit autoupdate. PR [#500](https://github.com/tiangolo/typer/pull/500) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
|
||||
* ⬆ Bump actions/cache from 2 to 3. PR [#496](https://github.com/tiangolo/typer/pull/496) by [@dependabot[bot]](https://github.com/apps/dependabot).
|
||||
* ✏️ Fix typo in datetime docs. PR [#495](https://github.com/tiangolo/typer/pull/495) by [@huxuan](https://github.com/huxuan).
|
||||
* ⬆ Bump dawidd6/action-download-artifact from 2.24.1 to 2.24.2. PR [#494](https://github.com/tiangolo/typer/pull/494) by [@dependabot[bot]](https://github.com/apps/dependabot).
|
||||
* ⬆ Bump dawidd6/action-download-artifact from 2.9.0 to 2.24.1. PR [#491](https://github.com/tiangolo/typer/pull/491) by [@dependabot[bot]](https://github.com/apps/dependabot).
|
||||
* ⬆ Bump actions/setup-python from 2 to 4. PR [#492](https://github.com/tiangolo/typer/pull/492) by [@dependabot[bot]](https://github.com/apps/dependabot).
|
||||
* 👷♂️ Consistently use `sys.executable` to run subprocesses, needed by OpenSUSE. PR [#408](https://github.com/tiangolo/typer/pull/408) by [@theMarix](https://github.com/theMarix).
|
||||
* 👷♂️ Ensure the `PYTHONPATH` is set properly when testing the tutorial scripts. PR [#407](https://github.com/tiangolo/typer/pull/407) by [@theMarix](https://github.com/theMarix).
|
||||
* ✏️ Add quotes to package name that includes brackets in docs. PR [#475](https://github.com/tiangolo/typer/pull/475) by [@gjolga](https://github.com/gjolga).
|
||||
|
||||
## 0.7.0
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ Make `typer.run()` not add completion scripts by default, it only makes sense in installed apps. Also update docs for handling [autocompletion in CLI options](https://typer.tiangolo.com/tutorial/options-autocompletion/). PR [#488](https://github.com/tiangolo/typer/pull/488) by [@tiangolo](https://github.com/tiangolo).
|
||||
* ✨ Add support for Python 3.11, tests in CI and official marker. PR [#487](https://github.com/tiangolo/typer/pull/487) by [@tiangolo](https://github.com/tiangolo).
|
||||
* 👷 Add CI for Python 3.10. PR [#384](https://github.com/tiangolo/typer/pull/384) by [@tiangolo](https://github.com/tiangolo).
|
||||
|
||||
### Fixes
|
||||
|
||||
* 🎨 Fix type annotation of `typer.run()`. PR [#284](https://github.com/tiangolo/typer/pull/284) by [@yassu](https://github.com/yassu).
|
||||
* 🎨 Fix type annotations for `get_group`. PR [#430](https://github.com/tiangolo/typer/pull/430) by [@tiangolo](https://github.com/tiangolo).
|
||||
|
||||
### Docs
|
||||
|
||||
* 📝 Add note about how subcommands with function names using underscores are converted to dashes. PR [#403](https://github.com/tiangolo/typer/pull/403) by [@targhs](https://github.com/targhs).
|
||||
* 📝 Fix typo in docs at `docs/tutorial/commands/help.md`. PR [#466](https://github.com/tiangolo/typer/pull/466) by [@fepegar](https://github.com/fepegar).
|
||||
* ✏ Fix link in docs to `datetime.strptime()`. PR [#464](https://github.com/tiangolo/typer/pull/464) by [@Kobu](https://github.com/Kobu).
|
||||
* ✏ Update `first-steps.md`, clarify distinction between parameter and argument. PR [#176](https://github.com/tiangolo/typer/pull/176) by [@mccarthysean](https://github.com/mccarthysean).
|
||||
* ✏ Fix broken plac link. PR [#275](https://github.com/tiangolo/typer/pull/275) by [@mgielda](https://github.com/mgielda).
|
||||
|
||||
### Internal
|
||||
|
||||
* ✅ Add extra tests just for coverage because monkeypatching with strange imports confuses coverage. PR [#490](https://github.com/tiangolo/typer/pull/490) by [@tiangolo](https://github.com/tiangolo).
|
||||
* 🔧 Tweak pytest coverage. PR [#485](https://github.com/tiangolo/typer/pull/485) by [@tiangolo](https://github.com/tiangolo).
|
||||
* ➕ Bring back pytest-cov because coverage can't detect pytest-xdist. PR [#484](https://github.com/tiangolo/typer/pull/484) by [@tiangolo](https://github.com/tiangolo).
|
||||
* ⬆ Bump actions/upload-artifact from 2 to 3. PR [#477](https://github.com/tiangolo/typer/pull/477) by [@dependabot[bot]](https://github.com/apps/dependabot).
|
||||
* ⬆ Bump actions/checkout from 2 to 3. PR [#478](https://github.com/tiangolo/typer/pull/478) by [@dependabot[bot]](https://github.com/apps/dependabot).
|
||||
* ⬆ [pre-commit.ci] pre-commit autoupdate. PR [#411](https://github.com/tiangolo/typer/pull/411) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
|
||||
* ⬆ Bump nwtgck/actions-netlify from 1.1.5 to 1.2.4. PR [#479](https://github.com/tiangolo/typer/pull/479) by [@dependabot[bot]](https://github.com/apps/dependabot).
|
||||
* ⬆ Bump tiangolo/issue-manager from 0.2.0 to 0.4.0. PR [#481](https://github.com/tiangolo/typer/pull/481) by [@dependabot[bot]](https://github.com/apps/dependabot).
|
||||
* 👷 Move from pytest-cov to coverage and Codecov to Smokeshow. PR [#483](https://github.com/tiangolo/typer/pull/483) by [@tiangolo](https://github.com/tiangolo).
|
||||
* ➕ Add extra Material for MkDocs deps for docs. PR [#482](https://github.com/tiangolo/typer/pull/482) by [@tiangolo](https://github.com/tiangolo).
|
||||
* 🔧 Update Dependabot config. PR [#476](https://github.com/tiangolo/typer/pull/476) by [@tiangolo](https://github.com/tiangolo).
|
||||
|
||||
## 0.6.1
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ $ python main.py delete --help
|
|||
|
||||
</div>
|
||||
|
||||
### Rich Markown
|
||||
### Rich Markdown
|
||||
|
||||
If you set `rich_markup_mode="markdown"` when creating the `typer.Typer()` app, you will be able to use Markdown in the docstring:
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ When you use `typer.run()`, **Typer** is doing more or less the same as above, i
|
|||
|
||||
In our case, this decorator tells **Typer** that the function below is a "`command`".
|
||||
|
||||
Both ways, with `typer.run()` and creating the explicit application, achieve the same.
|
||||
Both ways, with `typer.run()` and creating the explicit application, achieve almost the same.
|
||||
|
||||
!!! tip
|
||||
If your use case is solved with just `typer.run()`, that's fine, you don't have to create the explicit `app` and use `@app.command()`, etc.
|
||||
|
@ -114,6 +114,44 @@ Options:
|
|||
|
||||
</div>
|
||||
|
||||
## CLI application completion
|
||||
|
||||
There's a little detail that is worth noting here.
|
||||
|
||||
To get shell/tab completion, it's necessary to build a package that you and your users can install and **call directly**.
|
||||
|
||||
So instead of running a Python script like:
|
||||
|
||||
<div class="termy">
|
||||
|
||||
```console
|
||||
$ python main.py
|
||||
|
||||
✨ Some magic here ✨
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
...It would be called like:
|
||||
|
||||
<div class="termy">
|
||||
|
||||
```console
|
||||
$ magic-app
|
||||
|
||||
✨ Some magic here ✨
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
Having a standalone program like that allows setting up shell/tab completion.
|
||||
|
||||
The first step to be able to create an installable package like that is to use an explicit `typer.Typer()` app.
|
||||
|
||||
Later you can learn all the process to create a standalone CLI application and [Build a Package](../package.md){.internal-link target=_blank}.
|
||||
|
||||
But for now, it's just good to know that you are on that path. 😎
|
||||
|
||||
## A CLI application with multiple commands
|
||||
|
||||
Coming back to the CLI applications with multiple commands/subcommands, **Typer** allows creating CLI applications with multiple of them.
|
||||
|
|
|
@ -44,3 +44,13 @@ Creating user: Camila
|
|||
```
|
||||
|
||||
</div>
|
||||
|
||||
Note that any underscores in the function name will be replaced with dashes.
|
||||
|
||||
So if your function is something like:
|
||||
|
||||
```Python
|
||||
def create_user(username: str):
|
||||
...
|
||||
```
|
||||
Then the command name will be `create-user`.
|
||||
|
|
|
@ -432,14 +432,14 @@ are called "Python function parameters" or "Python function arguments".
|
|||
|
||||
It's quite technical... and somewhat pedantic.
|
||||
|
||||
One refers to the variable name in a function *declaration*. Like:
|
||||
*Parameter* refers to the variable name in a function *declaration*. Like:
|
||||
|
||||
```
|
||||
def bring_person(name: str, lastname: str = ""):
|
||||
pass
|
||||
```
|
||||
|
||||
The other refers to the value passed when *calling* a function. Like:
|
||||
*Argument* refers to the value passed when *calling* a function. Like:
|
||||
|
||||
```
|
||||
person = bring_person("Camila", lastname="Gutiérrez")
|
||||
|
|
|
@ -12,10 +12,10 @@ After installing completion (for your own Python package or for **Typer CLI**),
|
|||
|
||||
To check it quickly without creating a new Python package, install [Typer CLI](../../typer-cli.md){.internal-link target=_blank}.
|
||||
|
||||
Then let's create small example script:
|
||||
Then let's create small example program:
|
||||
|
||||
```Python
|
||||
{!../docs_src/options/autocompletion/tutorial001.py!}
|
||||
{!../docs_src/options_autocompletion/tutorial001.py!}
|
||||
```
|
||||
|
||||
And let's try it with **Typer CLI** to get completion:
|
||||
|
@ -50,8 +50,8 @@ Right now we get completion for the *CLI option* names, but not for the values.
|
|||
|
||||
We can provide completion for the values creating an `autocompletion` function, similar to the `callback` functions from [CLI Option Callback and Context](./callback-and-context.md){.internal-link target=_blank}:
|
||||
|
||||
```Python hl_lines="4 5 10"
|
||||
{!../docs_src/options/autocompletion/tutorial002.py!}
|
||||
```Python hl_lines="4-5 14"
|
||||
{!../docs_src/options_autocompletion/tutorial002.py!}
|
||||
```
|
||||
|
||||
We return a `list` of strings from the `complete_name()` function.
|
||||
|
@ -81,8 +81,8 @@ Modify the `complete_name()` function to receive a parameter of type `str`, it w
|
|||
|
||||
Then we can check and return only the values that start with the incomplete value from the command line:
|
||||
|
||||
```Python hl_lines="6 7 8 9 10 11"
|
||||
{!../docs_src/options/autocompletion/tutorial003.py!}
|
||||
```Python hl_lines="6-11"
|
||||
{!../docs_src/options_autocompletion/tutorial003.py!}
|
||||
```
|
||||
|
||||
Now let's try it:
|
||||
|
@ -120,7 +120,7 @@ In the `complete_name()` function, instead of providing one `str` per completion
|
|||
So, in the end, we return a `list` of `tuples` of `str`:
|
||||
|
||||
```Python hl_lines="3 4 5 6 7 10 11 12 13 14 15 16"
|
||||
{!../docs_src/options/autocompletion/tutorial004.py!}
|
||||
{!../docs_src/options_autocompletion/tutorial004.py!}
|
||||
```
|
||||
|
||||
!!! tip
|
||||
|
@ -157,7 +157,7 @@ Instead of creating and returning a list with values (`str` or `tuple`), we can
|
|||
That way our function will be a <a href="https://docs.python.org/3.8/glossary.html#index-19" class="external-link" target="_blank">generator</a> that **Typer** (actually Click) can iterate:
|
||||
|
||||
```Python hl_lines="10 11 12 13"
|
||||
{!../docs_src/options/autocompletion/tutorial005.py!}
|
||||
{!../docs_src/options_autocompletion/tutorial005.py!}
|
||||
```
|
||||
|
||||
That simplifies our code a bit and works the same.
|
||||
|
@ -185,8 +185,8 @@ So, we will allow multiple `--name` *CLI options*.
|
|||
|
||||
For this we use a `List` of `str`:
|
||||
|
||||
```Python hl_lines="6 7 8"
|
||||
{!../docs_src/options/autocompletion/tutorial006.py!}
|
||||
```Python hl_lines="8-11"
|
||||
{!../docs_src/options_autocompletion/tutorial006.py!}
|
||||
```
|
||||
|
||||
And then we can use it like:
|
||||
|
@ -213,7 +213,7 @@ But you can access the context by declaring a function parameter of type `typer.
|
|||
And from that context you can get the current values for each parameter.
|
||||
|
||||
```Python hl_lines="12 13 15"
|
||||
{!../docs_src/options/autocompletion/tutorial007.py!}
|
||||
{!../docs_src/options_autocompletion/tutorial007.py!}
|
||||
```
|
||||
|
||||
We are getting the `names` already provided with `--name` in the command line before this completion was triggered.
|
||||
|
@ -282,7 +282,7 @@ You can print to "standard error" with a **Rich** `Console(stderr=True)`.
|
|||
Using `stderr=True` tells **Rich** that the output should be shown in "standard error".
|
||||
|
||||
```Python hl_lines="12 15-16"
|
||||
{!../docs_src/options/autocompletion/tutorial008.py!}
|
||||
{!../docs_src/options_autocompletion/tutorial008.py!}
|
||||
```
|
||||
|
||||
!!! info
|
||||
|
@ -323,7 +323,7 @@ Sebastian -- The type hints guy.
|
|||
Of course, you can declare everything if you need it, the context, the raw *CLI parameters*, and the incomplete `str`:
|
||||
|
||||
```Python hl_lines="15"
|
||||
{!../docs_src/options/autocompletion/tutorial009.py!}
|
||||
{!../docs_src/options_autocompletion/tutorial009.py!}
|
||||
```
|
||||
|
||||
Check it:
|
|
@ -49,7 +49,7 @@ Add `typer[all]` to your dependencies:
|
|||
<div class="termy">
|
||||
|
||||
```console
|
||||
$ poetry add typer[all]
|
||||
$ poetry add "typer[all]"
|
||||
|
||||
// It creates a virtual environment for your project
|
||||
Creating virtualenv rick-portal-gun-w31dJa0b-py3.6 in /home/rick/.cache/pypoetry/virtualenvs
|
||||
|
|
|
@ -10,7 +10,7 @@ Typer will accept any string from the following formats:
|
|||
|
||||
* `%Y-%m-%d`
|
||||
* `%Y-%m-%dT%H:%M:%S`
|
||||
* `%Y-%m%d %H:%M:%S`
|
||||
* `%Y-%m-%d %H:%M:%S`
|
||||
|
||||
Check it:
|
||||
|
||||
|
@ -49,7 +49,7 @@ Error: Invalid value for '[%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]': inval
|
|||
|
||||
You can also customize the formats received for the `datetime` with the `formats` parameter.
|
||||
|
||||
`formats` receives a list of strings with the date formats that would be passed to <a href="https://docs.python.org/3/library/datetime.html#datetime.date.strftime" class="external-link" target="_blank">datetime.strptime()</a>.
|
||||
`formats` receives a list of strings with the date formats that would be passed to <a href="https://docs.python.org/3/library/datetime.html#datetime.datetime.strptime" class="external-link" target="_blank">datetime.strptime()</a>.
|
||||
|
||||
For example, let's imagine that you want to accept an ISO formatted datetime, but for some strange reason, you also want to accept a format with:
|
||||
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import typer
|
||||
|
||||
app = typer.Typer()
|
||||
|
||||
|
||||
@app.command()
|
||||
def main(name: str = typer.Option("World", help="The name to say hi to.")):
|
||||
print(f"Hello {name}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
||||
app()
|
|
@ -5,6 +5,10 @@ def complete_name():
|
|||
return ["Camila", "Carlos", "Sebastian"]
|
||||
|
||||
|
||||
app = typer.Typer()
|
||||
|
||||
|
||||
@app.command()
|
||||
def main(
|
||||
name: str = typer.Option(
|
||||
"World", help="The name to say hi to.", autocompletion=complete_name
|
||||
|
@ -14,4 +18,4 @@ def main(
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
||||
app()
|
|
@ -11,6 +11,10 @@ def complete_name(incomplete: str):
|
|||
return completion
|
||||
|
||||
|
||||
app = typer.Typer()
|
||||
|
||||
|
||||
@app.command()
|
||||
def main(
|
||||
name: str = typer.Option(
|
||||
"World", help="The name to say hi to.", autocompletion=complete_name
|
||||
|
@ -20,4 +24,4 @@ def main(
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
||||
app()
|
|
@ -16,6 +16,10 @@ def complete_name(incomplete: str):
|
|||
return completion
|
||||
|
||||
|
||||
app = typer.Typer()
|
||||
|
||||
|
||||
@app.command()
|
||||
def main(
|
||||
name: str = typer.Option(
|
||||
"World", help="The name to say hi to.", autocompletion=complete_name
|
||||
|
@ -25,4 +29,4 @@ def main(
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
||||
app()
|
|
@ -13,6 +13,10 @@ def complete_name(incomplete: str):
|
|||
yield (name, help_text)
|
||||
|
||||
|
||||
app = typer.Typer()
|
||||
|
||||
|
||||
@app.command()
|
||||
def main(
|
||||
name: str = typer.Option(
|
||||
"World", help="The name to say hi to.", autocompletion=complete_name
|
||||
|
@ -22,4 +26,4 @@ def main(
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
||||
app()
|
|
@ -2,11 +2,14 @@ from typing import List
|
|||
|
||||
import typer
|
||||
|
||||
app = typer.Typer()
|
||||
|
||||
|
||||
@app.command()
|
||||
def main(name: List[str] = typer.Option(["World"], help="The name to say hi to.")):
|
||||
for each_name in name:
|
||||
print(f"Hello {each_name}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
||||
app()
|
|
@ -16,6 +16,10 @@ def complete_name(ctx: typer.Context, incomplete: str):
|
|||
yield (name, help_text)
|
||||
|
||||
|
||||
app = typer.Typer()
|
||||
|
||||
|
||||
@app.command()
|
||||
def main(
|
||||
name: List[str] = typer.Option(
|
||||
["World"], help="The name to say hi to.", autocompletion=complete_name
|
||||
|
@ -26,4 +30,4 @@ def main(
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
||||
app()
|
|
@ -19,6 +19,10 @@ def complete_name(args: List[str], incomplete: str):
|
|||
yield (name, help_text)
|
||||
|
||||
|
||||
app = typer.Typer()
|
||||
|
||||
|
||||
@app.command()
|
||||
def main(
|
||||
name: List[str] = typer.Option(
|
||||
["World"], help="The name to say hi to.", autocompletion=complete_name
|
||||
|
@ -29,4 +33,4 @@ def main(
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
||||
app()
|
|
@ -20,6 +20,10 @@ def complete_name(ctx: typer.Context, args: List[str], incomplete: str):
|
|||
yield (name, help_text)
|
||||
|
||||
|
||||
app = typer.Typer()
|
||||
|
||||
|
||||
@app.command()
|
||||
def main(
|
||||
name: List[str] = typer.Option(
|
||||
["World"], help="The name to say hi to.", autocompletion=complete_name
|
||||
|
@ -30,4 +34,4 @@ def main(
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
||||
app()
|
|
@ -41,7 +41,6 @@ nav:
|
|||
- CLI Option Name: tutorial/options/name.md
|
||||
- CLI Option Callback and Context: tutorial/options/callback-and-context.md
|
||||
- Version CLI Option, is_eager: tutorial/options/version.md
|
||||
- CLI Option autocompletion: tutorial/options/autocompletion.md
|
||||
- Commands:
|
||||
- Commands Intro: tutorial/commands/index.md
|
||||
- Command CLI Arguments: tutorial/commands/arguments.md
|
||||
|
@ -51,6 +50,7 @@ nav:
|
|||
- Typer Callback: tutorial/commands/callback.md
|
||||
- One or Multiple Commands: tutorial/commands/one-or-multiple.md
|
||||
- Using the Context: tutorial/commands/context.md
|
||||
- CLI Option autocompletion: tutorial/options-autocompletion.md
|
||||
- CLI Parameter Types:
|
||||
- CLI Parameter Types Intro: tutorial/parameter-types/index.md
|
||||
- Number: tutorial/parameter-types/number.md
|
||||
|
|
|
@ -24,6 +24,9 @@ classifiers = [
|
|||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"License :: OSI Approved :: MIT License"
|
||||
]
|
||||
requires = [
|
||||
|
@ -38,10 +41,10 @@ Documentation = "https://typer.tiangolo.com/"
|
|||
[tool.flit.metadata.requires-extra]
|
||||
test = [
|
||||
"shellingham >=1.3.0,<2.0.0",
|
||||
"pytest >=4.4.0,<5.4.0",
|
||||
"pytest-cov >=2.10.0,<3.0.0",
|
||||
"coverage >=5.2,<6.0",
|
||||
"pytest-xdist >=1.32.0,<2.0.0",
|
||||
"pytest >=4.4.0,<8.0.0",
|
||||
"pytest-cov >=2.10.0,<5.0.0",
|
||||
"coverage >=6.2,<7.0",
|
||||
"pytest-xdist >=1.32.0,<4.0.0",
|
||||
"pytest-sugar >=0.9.4,<0.10.0",
|
||||
"mypy ==0.910",
|
||||
"black >=22.3.0,<23.0.0",
|
||||
|
@ -52,6 +55,8 @@ doc = [
|
|||
"mkdocs >=1.1.2,<2.0.0",
|
||||
"mkdocs-material >=8.1.4,<9.0.0",
|
||||
"mdx-include >=1.4.1,<2.0.0",
|
||||
"pillow >=9.3.0,<10.0.0",
|
||||
"cairosvg >=2.5.2,<3.0.0",
|
||||
]
|
||||
dev = [
|
||||
"autoflake >=1.3.1,<2.0.0",
|
||||
|
@ -72,3 +77,19 @@ skip_glob = [
|
|||
"docs_src/subcommands/tutorial003/lands.py",
|
||||
"docs_src/subcommands/tutorial003/main.py",
|
||||
]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
addopts = [
|
||||
"--strict-config",
|
||||
"--strict-markers",
|
||||
]
|
||||
xfail_strict = true
|
||||
junit_family = "xunit2"
|
||||
filterwarnings = [
|
||||
"error",
|
||||
# TODO: until I refactor completion to use the new shell_complete
|
||||
"ignore:'autocompletion' is renamed to 'shell_complete'. The old name is deprecated and will be removed in Click 8.1. See the docs about 'Parameter' for information about new behavior.:DeprecationWarning:typer",
|
||||
'ignore:starlette.middleware.wsgi is deprecated and will be removed in a future release\..*:DeprecationWarning:starlette',
|
||||
# For pytest-xdist
|
||||
'ignore::DeprecationWarning:xdist',
|
||||
]
|
||||
|
|
|
@ -8,5 +8,5 @@ export TERMINAL_WIDTH=3000
|
|||
# Force disable terminal for tests inside of pytest, takes precedence over GITHUB_ACTIONS env var
|
||||
export _TYPER_FORCE_DISABLE_TERMINAL=1
|
||||
bash ./scripts/test-files.sh
|
||||
# Use xdist-pytest --forked to ensure modified sys.path to import relative modules in examples keeps working
|
||||
pytest --cov=typer --cov=tests --cov=docs_src --cov-report=term-missing --cov-report=xml -o console_output_style=progress --forked --numprocesses=auto ${@}
|
||||
# It seems xdist-pytest ensures modified sys.path to import relative modules in examples keeps working
|
||||
pytest --cov-config=.coveragerc --cov --cov-report=term-missing -o console_output_style=progress --numprocesses=auto ${@}
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
set -x
|
||||
set -e
|
||||
|
||||
cd ./site
|
||||
|
||||
if [ -f docs.zip ]; then
|
||||
rm -rf docs.zip
|
||||
fi
|
||||
zip -r docs.zip ./site
|
||||
zip -r docs.zip ./
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer.core
|
||||
from typer.testing import CliRunner
|
||||
|
@ -40,7 +41,7 @@ def test_coverage_call():
|
|||
|
||||
def test_completion():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -3,7 +3,7 @@ import subprocess
|
|||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from docs_src.first_steps import tutorial001 as mod
|
||||
from docs_src.commands.index import tutorial001 as mod
|
||||
|
||||
|
||||
def test_show_completion():
|
||||
|
@ -47,7 +47,7 @@ def test_install_completion():
|
|||
|
||||
def test_completion_invalid_instruction():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -63,7 +63,7 @@ def test_completion_invalid_instruction():
|
|||
|
||||
def test_completion_source_bash():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -81,7 +81,7 @@ def test_completion_source_bash():
|
|||
|
||||
def test_completion_source_invalid_shell():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -96,7 +96,7 @@ def test_completion_source_invalid_shell():
|
|||
|
||||
def test_completion_source_invalid_instruction():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -111,7 +111,7 @@ def test_completion_source_invalid_instruction():
|
|||
|
||||
def test_completion_source_zsh():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -126,7 +126,7 @@ def test_completion_source_zsh():
|
|||
|
||||
def test_completion_source_fish():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -141,7 +141,7 @@ def test_completion_source_fish():
|
|||
|
||||
def test_completion_source_powershell():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -159,7 +159,7 @@ def test_completion_source_powershell():
|
|||
|
||||
def test_completion_source_pwsh():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from docs_src.commands.help import tutorial001 as mod
|
||||
|
||||
|
||||
def test_completion_complete_subcommand_bash():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -23,7 +24,7 @@ def test_completion_complete_subcommand_bash():
|
|||
|
||||
def test_completion_complete_subcommand_bash_invalid():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -40,7 +41,7 @@ def test_completion_complete_subcommand_bash_invalid():
|
|||
|
||||
def test_completion_complete_subcommand_zsh():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -59,7 +60,7 @@ def test_completion_complete_subcommand_zsh():
|
|||
|
||||
def test_completion_complete_subcommand_zsh_files():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -75,7 +76,7 @@ def test_completion_complete_subcommand_zsh_files():
|
|||
|
||||
def test_completion_complete_subcommand_fish():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -95,7 +96,7 @@ def test_completion_complete_subcommand_fish():
|
|||
|
||||
def test_completion_complete_subcommand_fish_should_complete():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -112,7 +113,7 @@ def test_completion_complete_subcommand_fish_should_complete():
|
|||
|
||||
def test_completion_complete_subcommand_fish_should_complete_no():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -129,7 +130,7 @@ def test_completion_complete_subcommand_fish_should_complete_no():
|
|||
|
||||
def test_completion_complete_subcommand_powershell():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -147,7 +148,7 @@ def test_completion_complete_subcommand_powershell():
|
|||
|
||||
def test_completion_complete_subcommand_pwsh():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -165,7 +166,7 @@ def test_completion_complete_subcommand_pwsh():
|
|||
|
||||
def test_completion_complete_subcommand_noshell():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from docs_src.commands.index import tutorial002 as mod
|
||||
|
||||
|
||||
def test_completion_complete_subcommand_zsh():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -23,7 +24,7 @@ def test_completion_complete_subcommand_zsh():
|
|||
|
||||
def test_completion_complete_subcommand_fish():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -40,7 +41,7 @@ def test_completion_complete_subcommand_fish():
|
|||
|
||||
def test_completion_complete_subcommand_powershell():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -56,7 +57,7 @@ def test_completion_complete_subcommand_powershell():
|
|||
|
||||
def test_completion_complete_subcommand_pwsh():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from unittest import mock
|
||||
|
||||
|
@ -7,7 +8,7 @@ import shellingham
|
|||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
||||
from docs_src.first_steps import tutorial001 as mod
|
||||
from docs_src.commands.index import tutorial001 as mod
|
||||
|
||||
runner = CliRunner()
|
||||
app = typer.Typer()
|
||||
|
@ -16,7 +17,7 @@ app.command()(mod.main)
|
|||
|
||||
def test_completion_install_no_shell():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--install-completion"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--install-completion"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -39,7 +40,15 @@ def test_completion_install_bash():
|
|||
if bash_completion_path.is_file():
|
||||
text = bash_completion_path.read_text()
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--install-completion", "bash"],
|
||||
[
|
||||
sys.executable,
|
||||
"-m",
|
||||
"coverage",
|
||||
"run",
|
||||
mod.__file__,
|
||||
"--install-completion",
|
||||
"bash",
|
||||
],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -74,7 +83,15 @@ def test_completion_install_zsh():
|
|||
if completion_path.is_file():
|
||||
text = completion_path.read_text()
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--install-completion", "zsh"],
|
||||
[
|
||||
sys.executable,
|
||||
"-m",
|
||||
"coverage",
|
||||
"run",
|
||||
mod.__file__,
|
||||
"--install-completion",
|
||||
"zsh",
|
||||
],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -103,7 +120,15 @@ def test_completion_install_fish():
|
|||
Path.home() / f".config/fish/completions/{script_path.name}.fish"
|
||||
)
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--install-completion", "fish"],
|
||||
[
|
||||
sys.executable,
|
||||
"-m",
|
||||
"coverage",
|
||||
"run",
|
||||
mod.__file__,
|
||||
"--install-completion",
|
||||
"fish",
|
||||
],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from docs_src.first_steps import tutorial001 as mod
|
||||
from docs_src.commands.index import tutorial001 as mod
|
||||
|
||||
|
||||
def test_completion_show_no_shell():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--show-completion"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--show-completion"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -25,7 +26,15 @@ def test_completion_show_no_shell():
|
|||
|
||||
def test_completion_show_bash():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--show-completion", "bash"],
|
||||
[
|
||||
sys.executable,
|
||||
"-m",
|
||||
"coverage",
|
||||
"run",
|
||||
mod.__file__,
|
||||
"--show-completion",
|
||||
"bash",
|
||||
],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -43,7 +52,15 @@ def test_completion_show_bash():
|
|||
|
||||
def test_completion_source_zsh():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--show-completion", "zsh"],
|
||||
[
|
||||
sys.executable,
|
||||
"-m",
|
||||
"coverage",
|
||||
"run",
|
||||
mod.__file__,
|
||||
"--show-completion",
|
||||
"zsh",
|
||||
],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -58,7 +75,15 @@ def test_completion_source_zsh():
|
|||
|
||||
def test_completion_source_fish():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--show-completion", "fish"],
|
||||
[
|
||||
sys.executable,
|
||||
"-m",
|
||||
"coverage",
|
||||
"run",
|
||||
mod.__file__,
|
||||
"--show-completion",
|
||||
"fish",
|
||||
],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -73,7 +98,15 @@ def test_completion_source_fish():
|
|||
|
||||
def test_completion_source_powershell():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--show-completion", "powershell"],
|
||||
[
|
||||
sys.executable,
|
||||
"-m",
|
||||
"coverage",
|
||||
"run",
|
||||
mod.__file__,
|
||||
"--show-completion",
|
||||
"powershell",
|
||||
],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -91,7 +124,15 @@ def test_completion_source_powershell():
|
|||
|
||||
def test_completion_source_pwsh():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--show-completion", "pwsh"],
|
||||
[
|
||||
sys.executable,
|
||||
"-m",
|
||||
"coverage",
|
||||
"run",
|
||||
mod.__file__,
|
||||
"--show-completion",
|
||||
"pwsh",
|
||||
],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from unittest import mock
|
||||
|
||||
|
@ -97,7 +98,7 @@ def test_callback_3_untyped_parameters():
|
|||
def test_completion_untyped_parameters():
|
||||
file_path = Path(__file__).parent / "assets/completion_no_types.py"
|
||||
result = subprocess.run(
|
||||
["coverage", "run", str(file_path)],
|
||||
[sys.executable, "-m", "coverage", "run", str(file_path)],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -119,7 +120,7 @@ def test_completion_untyped_parameters():
|
|||
assert '"Carlos":"The writer of scripts."' in result.stdout
|
||||
|
||||
result = subprocess.run(
|
||||
["coverage", "run", str(file_path)],
|
||||
[sys.executable, "-m", "coverage", "run", str(file_path)],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -130,7 +131,7 @@ def test_completion_untyped_parameters():
|
|||
def test_completion_untyped_parameters_different_order_correct_names():
|
||||
file_path = Path(__file__).parent / "assets/completion_no_types_order.py"
|
||||
result = subprocess.run(
|
||||
["coverage", "run", str(file_path)],
|
||||
[sys.executable, "-m", "coverage", "run", str(file_path)],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -152,7 +153,7 @@ def test_completion_untyped_parameters_different_order_correct_names():
|
|||
assert '"Carlos":"The writer of scripts."' in result.stdout
|
||||
|
||||
result = subprocess.run(
|
||||
["coverage", "run", str(file_path)],
|
||||
[sys.executable, "-m", "coverage", "run", str(file_path)],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def test_custom_prog_name():
|
||||
file_path = Path(__file__).parent / "assets/prog_name.py"
|
||||
result = subprocess.run(
|
||||
["coverage", "run", str(file_path), "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", str(file_path), "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def test_traceback_no_rich():
|
||||
file_path = Path(__file__).parent / "assets/type_error_no_rich.py"
|
||||
result = subprocess.run(
|
||||
["coverage", "run", str(file_path)],
|
||||
[sys.executable, "-m", "coverage", "run", str(file_path)],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -26,7 +27,7 @@ def test_traceback_no_rich():
|
|||
def test_traceback_no_rich_short_disable():
|
||||
file_path = Path(__file__).parent / "assets/type_error_no_rich_short_disable.py"
|
||||
result = subprocess.run(
|
||||
["coverage", "run", str(file_path)],
|
||||
[sys.executable, "-m", "coverage", "run", str(file_path)],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -46,7 +47,7 @@ def test_traceback_no_rich_short_disable():
|
|||
def test_unmodified_traceback():
|
||||
file_path = Path(__file__).parent / "assets/type_error_normal_traceback.py"
|
||||
result = subprocess.run(
|
||||
["coverage", "run", str(file_path)],
|
||||
[sys.executable, "-m", "coverage", "run", str(file_path)],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -33,7 +34,7 @@ def test_call_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -35,7 +36,7 @@ def test_call_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
import typer.core
|
||||
|
@ -53,7 +54,7 @@ def test_call_env_var_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -40,7 +41,7 @@ def test_call_env_var2():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -40,7 +41,7 @@ def test_call_env_var_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
import typer.core
|
||||
|
@ -43,7 +44,7 @@ def test_call_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -30,7 +31,7 @@ def test_call_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -30,7 +31,7 @@ def test_call_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -30,7 +31,7 @@ def test_call_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -28,7 +29,7 @@ def test_call_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -28,7 +29,7 @@ def test_call_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
import typer.core
|
||||
|
@ -28,7 +29,7 @@ def test_call_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
import typer.core
|
||||
|
@ -41,7 +42,7 @@ def test_call_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
import typer.core
|
||||
|
@ -42,7 +43,7 @@ def test_call_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -31,7 +32,7 @@ def test_call_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -35,7 +36,7 @@ def test_delete():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer.core
|
||||
from typer.testing import CliRunner
|
||||
|
@ -71,7 +72,7 @@ def test_wrong_verbose():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -18,7 +19,7 @@ def test_app():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -23,7 +24,7 @@ def test_for_coverage():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -25,7 +26,7 @@ def test_app():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -25,7 +26,7 @@ def test_delete():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -31,7 +32,7 @@ def test_callback():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -31,7 +32,7 @@ def test_callback():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -20,7 +21,7 @@ def test_1():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -117,7 +118,7 @@ def test_init():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -48,7 +49,7 @@ def test_delete():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -36,7 +37,7 @@ def test_call():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -51,7 +52,7 @@ def test_delete():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -52,7 +53,7 @@ def test_delete():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -43,7 +44,7 @@ def test_call():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -47,7 +48,7 @@ def test_call():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -24,7 +25,7 @@ def test_call():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -23,7 +24,7 @@ def test_arg():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -32,7 +33,7 @@ def test_delete():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -31,7 +32,7 @@ def test_delete():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -24,7 +25,7 @@ def test_command():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -26,7 +27,7 @@ def test_command():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -88,7 +89,7 @@ def test_init():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
@ -12,7 +13,7 @@ runner = CliRunner()
|
|||
def test_traceback_rich():
|
||||
file_path = Path(mod.__file__)
|
||||
result = subprocess.run(
|
||||
["coverage", "run", str(file_path)],
|
||||
[sys.executable, "-m", "coverage", "run", str(file_path)],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -34,7 +35,7 @@ def test_traceback_rich():
|
|||
def test_standard_traceback_env_var():
|
||||
file_path = Path(mod.__file__)
|
||||
result = subprocess.run(
|
||||
["coverage", "run", str(file_path)],
|
||||
[sys.executable, "-m", "coverage", "run", str(file_path)],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -55,7 +56,7 @@ def test_standard_traceback_env_var():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
@ -12,7 +13,7 @@ runner = CliRunner()
|
|||
def test_traceback_rich():
|
||||
file_path = Path(mod.__file__)
|
||||
result = subprocess.run(
|
||||
["coverage", "run", str(file_path), "secret"],
|
||||
[sys.executable, "-m", "coverage", "run", str(file_path), "secret"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -34,7 +35,7 @@ def test_traceback_rich():
|
|||
def test_standard_traceback_env_var():
|
||||
file_path = Path(mod.__file__)
|
||||
result = subprocess.run(
|
||||
["coverage", "run", str(file_path), "secret"],
|
||||
[sys.executable, "-m", "coverage", "run", str(file_path), "secret"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -55,7 +56,7 @@ def test_standard_traceback_env_var():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
@ -12,7 +13,7 @@ runner = CliRunner()
|
|||
def test_traceback_rich_pretty_short_disable():
|
||||
file_path = Path(mod.__file__)
|
||||
result = subprocess.run(
|
||||
["coverage", "run", str(file_path)],
|
||||
[sys.executable, "-m", "coverage", "run", str(file_path)],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -33,7 +34,7 @@ def test_traceback_rich_pretty_short_disable():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
@ -12,7 +13,7 @@ runner = CliRunner()
|
|||
def test_rich_pretty_exceptions_disable():
|
||||
file_path = Path(mod.__file__)
|
||||
result = subprocess.run(
|
||||
["coverage", "run", str(file_path)],
|
||||
[sys.executable, "-m", "coverage", "run", str(file_path)],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -31,7 +32,7 @@ def test_rich_pretty_exceptions_disable():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -17,7 +18,7 @@ def test_cli():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -25,7 +26,7 @@ def test_2():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -25,7 +26,7 @@ def test_2():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -49,7 +50,7 @@ def test_formal_3():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -49,7 +50,7 @@ def test_formal_1():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -44,7 +45,7 @@ def test_formal_1():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -19,7 +20,7 @@ def test_main():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -47,7 +48,7 @@ def test_valid_args():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -35,7 +36,7 @@ def test_3_user():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -30,7 +31,7 @@ def test_2_number():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -44,7 +45,7 @@ def test_invalid_user():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -25,7 +26,7 @@ def test_2():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -27,7 +28,7 @@ def test_2():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -37,7 +38,7 @@ def test_script():
|
|||
|
||||
def test_completion():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -27,7 +28,7 @@ def test_2():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
@ -37,7 +38,7 @@ def test_script():
|
|||
|
||||
def test_completion():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, " "],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, " "],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from typer.testing import CliRunner
|
||||
|
@ -40,7 +41,7 @@ def test_formal():
|
|||
|
||||
def test_script():
|
||||
result = subprocess.run(
|
||||
["coverage", "run", mod.__file__, "--help"],
|
||||
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue