---
source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs
snapshot_kind: text
---
PT027_1.py:11:14: PT027 [*] Use `pytest.raises` instead of unittest-style `assertRaises`
   |
10 |     def test_errors(self):
11 |         with self.assertRaises(ValueError):
   |              ^^^^^^^^^^^^^^^^^ PT027
12 |             raise ValueError
   |
   = help: Replace `assertRaises` with `pytest.raises`

ℹ Unsafe fix
8  8  |             raise ValueError
9  9  | 
10 10 |     def test_errors(self):
11    |-        with self.assertRaises(ValueError):
   11 |+        with pytest.raises(ValueError):
12 12 |             raise ValueError
