Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST: for mypy-diff (https://github.com/pytest-dev/pytest/pull/6486) #164

Closed
wants to merge 18 commits into from
Closed
39 changes: 21 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ on:
push:
branches:
- master
- diff-cover-mypy
- test-diff-cover-mypy
tags:
- "*"

pull_request:
branches:
- master
- diff-cover-mypy
- test-diff-cover-mypy

jobs:
build:
Expand All @@ -25,24 +29,7 @@ jobs:
fail-fast: false
matrix:
name: [
"windows-py35",
"windows-py36",
"windows-py37",
"windows-py37-pluggy",
"windows-py38",

"ubuntu-py35",
"ubuntu-py36",
"ubuntu-py37",
"ubuntu-py37-pluggy",
"ubuntu-py37-freeze",
"ubuntu-py38",
"ubuntu-pypy3",

"macos-py37",
"macos-py38",

"linting",
"mypy-diff",
]

include:
Expand Down Expand Up @@ -189,3 +176,19 @@ jobs:
run: |
sudo apt-get install pandoc
tox -e publish-gh-release-notes

mypy-diff:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade wheel setuptools tox
- name: tox -e mypy-diff
run: "tox -e mypy-diff"
8 changes: 8 additions & 0 deletions src/_pytest/debugging.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
from _pytest.config.exceptions import UsageError


def untyped() -> None:
pass


def _validate_usepdb_cls(value):
"""Validate syntax of --pdbcls option."""
try:
Expand All @@ -19,6 +23,10 @@ def _validate_usepdb_cls(value):
return (modname, classname)


def not_untyped() -> None:
pass


def pytest_addoption(parser):
group = parser.getgroup("general")
group._addoption(
Expand Down
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ commands = pre-commit run --all-files --show-diff-on-failure {posargs:}
extras = checkqa-mypy, testing
commands = mypy {posargs:src testing}

[testenv:mypy-diff]
extras = checkqa-mypy, testing
deps =
lxml
diff-cover
commands =
-mypy --cobertura-xml-report {envtmpdir} {posargs:src testing}
diff-cover --fail-under=100 --compare-branch={env:DIFF_BRANCH:origin/{env:GITHUB_BASE_REF:master}} {envtmpdir}/cobertura.xml

[testenv:docs]
basepython = python3
usedevelop = True
Expand Down