Skip to content

Commit

Permalink
Fix PT005 doc (#6596)
Browse files Browse the repository at this point in the history
  • Loading branch information
harupy authored Aug 15, 2023
1 parent b1c4c7b commit 81b1176
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crates/ruff/src/rules/flake8_pytest_style/rules/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ pub struct PytestMissingFixtureNameUnderscore {
function: String,
}

impl Violation for PytestMissingFixtureNameUnderscore {
#[derive_message_formats]
fn message(&self) -> String {
let PytestMissingFixtureNameUnderscore { function } = self;
format!("Fixture `{function}` does not return anything, add leading underscore")
}
}

/// ## What it does
/// Checks for `pytest` fixtures that return a value, but are named with a
/// leading underscore.
Expand Down Expand Up @@ -259,14 +267,6 @@ pub struct PytestMissingFixtureNameUnderscore {
///
/// ## References
/// - [`pytest` documentation: `@pytest.fixture` functions](https://docs.pytest.org/en/latest/reference/reference.html#pytest-fixture)
impl Violation for PytestMissingFixtureNameUnderscore {
#[derive_message_formats]
fn message(&self) -> String {
let PytestMissingFixtureNameUnderscore { function } = self;
format!("Fixture `{function}` does not return anything, add leading underscore")
}
}

#[violation]
pub struct PytestIncorrectFixtureNameUnderscore {
function: String,
Expand Down

0 comments on commit 81b1176

Please sign in to comment.