mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 22:01:18 +00:00
Make rule PT012 example clearer (#10248)
This commit is contained in:
parent
6159a8e532
commit
cbd927f346
1 changed files with 3 additions and 3 deletions
|
@ -26,8 +26,8 @@ use super::helpers::is_empty_or_null_string;
|
|||
///
|
||||
/// def test_foo():
|
||||
/// with pytest.raises(MyError):
|
||||
/// setup() # may raise `MyError`
|
||||
/// func_to_test()
|
||||
/// setup()
|
||||
/// func_to_test() # not executed if `setup()` raises `MyError`
|
||||
/// assert foo() # not executed
|
||||
/// ```
|
||||
///
|
||||
|
@ -38,7 +38,7 @@ use super::helpers::is_empty_or_null_string;
|
|||
///
|
||||
/// def test_foo():
|
||||
/// setup()
|
||||
/// with pytest.raises(MyException):
|
||||
/// with pytest.raises(MyError):
|
||||
/// func_to_test()
|
||||
/// assert foo()
|
||||
/// ```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue