Fix order of format args with warning
This commit is contained in:
parent
8aa0809fbc
commit
2e5cf1cc78
|
@ -72,7 +72,7 @@ def on_rm_rf_error(func, path: str, exc, *, start_path: Path) -> bool:
|
|||
warnings.warn(
|
||||
PytestWarning(
|
||||
"(rm_rf) unknown function {} when removing {}:\n{}: {}".format(
|
||||
path, func, exctype, excvalue
|
||||
func, path, exctype, excvalue
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -388,7 +388,10 @@ class TestRmRf:
|
|||
assert not on_rm_rf_error(None, str(fn), exc_info, start_path=tmp_path)
|
||||
|
||||
# unknown function
|
||||
with pytest.warns(pytest.PytestWarning):
|
||||
with pytest.warns(
|
||||
pytest.PytestWarning,
|
||||
match=r"^\(rm_rf\) unknown function None when removing .*foo.txt:\nNone: ",
|
||||
):
|
||||
exc_info = (None, PermissionError(), None)
|
||||
on_rm_rf_error(None, str(fn), exc_info, start_path=tmp_path)
|
||||
assert fn.is_file()
|
||||
|
|
Loading…
Reference in New Issue