Skip to content

✅ TST: Update sync flake8 tests #44189

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

Merged
merged 1 commit into from
Oct 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 0 additions & 96 deletions scripts/tests/test_sync_flake8_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,6 @@
from ..sync_flake8_versions import get_revisions


def test_wrong_yesqa_flake8(capsys):
precommit_config = {
"repos": [
{
"repo": "https://gitlab.com/pycqa/flake8",
"rev": "0.1.1",
"hooks": [
{
"id": "flake8",
}
],
},
{
"repo": "https://github.com/asottile/yesqa",
"rev": "v1.2.2",
"hooks": [
{
"id": "yesqa",
"additional_dependencies": [
"flake8==0.4.2",
],
}
],
},
]
}
environment = {
"dependencies": [
"flake8=0.1.1",
]
}
with pytest.raises(SystemExit, match=None):
get_revisions(precommit_config, environment)
result, _ = capsys.readouterr()
expected = "flake8 in 'yesqa' does not match in 'flake8' from 'pre-commit'\n"
assert result == expected


def test_wrong_env_flake8(capsys):
precommit_config = {
"repos": [
Expand All @@ -53,18 +15,6 @@ def test_wrong_env_flake8(capsys):
}
],
},
{
"repo": "https://github.com/asottile/yesqa",
"rev": "v1.2.2",
"hooks": [
{
"id": "yesqa",
"additional_dependencies": [
"flake8==0.4.2",
],
}
],
},
]
}
environment = {
Expand All @@ -81,52 +31,6 @@ def test_wrong_env_flake8(capsys):
assert result == expected


def test_wrong_yesqa_add_dep(capsys):
precommit_config = {
"repos": [
{
"repo": "https://gitlab.com/pycqa/flake8",
"rev": "0.1.1",
"hooks": [
{
"id": "flake8",
"additional_dependencies": [
"flake8-bugs==1.1.1",
],
}
],
},
{
"repo": "https://github.com/asottile/yesqa",
"rev": "v1.2.2",
"hooks": [
{
"id": "yesqa",
"additional_dependencies": [
"flake8==0.4.2",
"flake8-bugs>=1.1.1",
],
}
],
},
]
}
environment = {
"dependencies": [
"flake8=1.5.6",
"flake8-bugs=1.1.1",
]
}
with pytest.raises(SystemExit, match=None):
get_revisions(precommit_config, environment)
result, _ = capsys.readouterr()
expected = (
"Mismatch of 'flake8-bugs' version between 'flake8' and 'yesqa' in "
"'.pre-commit-config.yaml'\n"
)
assert result == expected


def test_wrong_env_add_dep(capsys):
precommit_config = {
"repos": [
Expand Down