mirror of https://github.com/astral-sh/ruff
Add more backticks to flake8-pytest-style error messages (#1707)
This commit is contained in:
parent
3abd205f94
commit
8c836aeecf
10
README.md
10
README.md
|
|
@ -918,20 +918,20 @@ For more, see [flake8-pytest-style](https://pypi.org/project/flake8-pytest-style
|
|||
| PT005 | IncorrectFixtureNameUnderscore | Fixture `...` returns a value, remove leading underscore | |
|
||||
| PT006 | ParametrizeNamesWrongType | Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 🛠 |
|
||||
| PT007 | ParametrizeValuesWrongType | Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` | |
|
||||
| PT008 | PatchWithLambda | Use `return_value=` instead of patching with lambda | |
|
||||
| PT009 | UnittestAssertion | Use a regular assert instead of unittest-style '...' | |
|
||||
| PT008 | PatchWithLambda | Use `return_value=` instead of patching with `lambda` | |
|
||||
| PT009 | UnittestAssertion | Use a regular `assert` instead of unittest-style `...` | |
|
||||
| PT010 | RaisesWithoutException | set the expected exception in `pytest.raises()` | |
|
||||
| PT011 | RaisesTooBroad | `pytest.raises(...)` is too broad, set the `match` parameter or use a more specific exception | |
|
||||
| PT012 | RaisesWithMultipleStatements | `pytest.raises()` block should contain a single simple statement | |
|
||||
| PT013 | IncorrectPytestImport | Found incorrect import of pytest, use simple `import pytest` instead | |
|
||||
| PT015 | AssertAlwaysFalse | Assertion always fails, replace with `pytest.fail()` | |
|
||||
| PT016 | FailWithoutMessage | No message passed to `pytest.fail()` | |
|
||||
| PT017 | AssertInExcept | Found assertion on exception ... in except block, use pytest.raises() instead | |
|
||||
| PT017 | AssertInExcept | Found assertion on exception `...` in except block, use `pytest.raises()` instead | |
|
||||
| PT018 | CompositeAssertion | Assertion should be broken down into multiple parts | |
|
||||
| PT019 | FixtureParamWithoutValue | Fixture ... without value is injected as parameter, use @pytest.mark.usefixtures instead | |
|
||||
| PT019 | FixtureParamWithoutValue | Fixture `...` without value is injected as parameter, use `@pytest.mark.usefixtures` instead | |
|
||||
| PT020 | DeprecatedYieldFixture | `@pytest.yield_fixture` is deprecated, use `@pytest.fixture` | |
|
||||
| PT021 | FixtureFinalizerCallback | Use `yield` instead of `request.addfinalizer` | |
|
||||
| PT022 | UselessYieldFixture | No teardown in fixture ..., use `return` instead of `yield` | 🛠 |
|
||||
| PT022 | UselessYieldFixture | No teardown in fixture `...`, use `return` instead of `yield` | 🛠 |
|
||||
| PT023 | IncorrectMarkParenthesesStyle | Use `@pytest.mark....` over `@pytest.mark....()` | 🛠 |
|
||||
| PT024 | UnnecessaryAsyncioMarkOnFixture | `pytest.mark.asyncio` is unnecessary for fixtures | |
|
||||
| PT025 | ErroneousUseFixturesOnFixture | `pytest.mark.usefixtures` has no effect on fixtures | |
|
||||
|
|
|
|||
|
|
@ -3526,10 +3526,10 @@ impl CheckKind {
|
|||
)
|
||||
}
|
||||
CheckKind::PatchWithLambda => {
|
||||
"Use `return_value=` instead of patching with lambda".to_string()
|
||||
"Use `return_value=` instead of patching with `lambda`".to_string()
|
||||
}
|
||||
CheckKind::UnittestAssertion(assertion) => {
|
||||
format!("Use a regular assert instead of unittest-style '{assertion}'")
|
||||
format!("Use a regular `assert` instead of unittest-style `{assertion}`")
|
||||
}
|
||||
CheckKind::RaisesWithoutException => {
|
||||
"set the expected exception in `pytest.raises()`".to_string()
|
||||
|
|
@ -3552,7 +3552,7 @@ impl CheckKind {
|
|||
CheckKind::FailWithoutMessage => "No message passed to `pytest.fail()`".to_string(),
|
||||
CheckKind::AssertInExcept(name) => {
|
||||
format!(
|
||||
"Found assertion on exception {name} in except block, use pytest.raises() \
|
||||
"Found assertion on exception `{name}` in except block, use `pytest.raises()` \
|
||||
instead"
|
||||
)
|
||||
}
|
||||
|
|
@ -3561,8 +3561,8 @@ impl CheckKind {
|
|||
}
|
||||
CheckKind::FixtureParamWithoutValue(name) => {
|
||||
format!(
|
||||
"Fixture {name} without value is injected as parameter, use \
|
||||
@pytest.mark.usefixtures instead"
|
||||
"Fixture `{name}` without value is injected as parameter, use \
|
||||
`@pytest.mark.usefixtures` instead"
|
||||
)
|
||||
}
|
||||
CheckKind::DeprecatedYieldFixture => {
|
||||
|
|
@ -3572,7 +3572,7 @@ impl CheckKind {
|
|||
"Use `yield` instead of `request.addfinalizer`".to_string()
|
||||
}
|
||||
CheckKind::UselessYieldFixture(name) => {
|
||||
format!("No teardown in fixture {name}, use `return` instead of `yield`")
|
||||
format!("No teardown in fixture `{name}`, use `return` instead of `yield`")
|
||||
}
|
||||
CheckKind::IncorrectMarkParenthesesStyle(mark_name, expected_parens, actual_parens) => {
|
||||
format!(
|
||||
|
|
|
|||
Loading…
Reference in New Issue