PYTHON-3793 Make tox fail with invalid environment (#1286)

This commit is contained in:
Noah Stapp 2023-07-03 09:17:11 -07:00 committed by GitHub
parent 0b5bdccf3a
commit 94fabf5e98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 10 deletions

View File

@ -359,7 +359,7 @@ functions:
${PREPARE_SHELL}
alias python=${PYTHON_BINARY}
python -m tox -e test-mockupdb
python -m tox -m test-mockupdb
"run doctests":
- command: shell.exec

View File

@ -4,4 +4,4 @@ set -o xtrace
set -o errexit
${PYTHON_BINARY} -m pip install tox
${PYTHON_BINARY} -m tox -e doc-test
${PYTHON_BINARY} -m tox -m doc-test

View File

@ -42,7 +42,7 @@ jobs:
mongodb-version: 4.4
- name: Run tests
run: |
tox -e test
tox -m test
mypytest:
name: Run mypy
@ -64,13 +64,13 @@ jobs:
pip install tox
- name: Run mypy
run: |
tox -e typecheck-mypy
tox -m typecheck-mypy
- name: Run pyright
run: |
tox -e typecheck-pyright
tox -m typecheck-pyright
- name: Run pyright strict
run: |
tox -e typecheck-pyright-strict
tox -m typecheck-pyright-strict
linkcheck:
name: Check Links
@ -86,4 +86,4 @@ jobs:
pip install tox
- name: Check links
run: |
tox -e linkcheck
tox -m linkcheck

View File

@ -36,7 +36,7 @@ Doing a Release
To test locally, ``python3 setup.py test`` will build the C extensions and
test. ``python3 tools/clean.py`` will remove the extensions,
and then ``python3 setup.py --no_ext test`` will run the tests without
them. You can also run the doctests: ``tox -e doc-test``.
them. You can also run the doctests: ``tox -m doc-test``.
2. Check Jira to ensure all the tickets in this version have been completed.

View File

@ -103,7 +103,7 @@ following command from the root directory of the **PyMongo** source:
.. code-block:: bash
$ pip install tox
$ tox -e docs
$ tox -m doc
Indices and tables
------------------

14
tox.ini
View File

@ -24,6 +24,19 @@ envlist =
doc-test,
# Linkcheck sphinx docs
linkcheck
labels = # Use labels and -m instead of -e so that tox -m <label> fails instantly if the label does not exist
test = test
test-encryption = test-encryption
lint = lint
lint-manual = lint-manual
typecheck-mypy = typecheck-mypy
typecheck-pyright = typecheck-pyright
typecheck-pyright-strict = typecheck-pyright-strict
typecheck = typecheck
doc = doc
doc-test = doc-test
linkcheck = linkcheck
test-mockupdb = test-mockupdb
[testenv:test]
description = run base set of unit tests with no extra functionality
@ -41,7 +54,6 @@ commands =
python --version
pytest {posargs}
[testenv:lint]
description = run pre-commit
deps =