Skip to content

Commit 88b8a36

Browse files
committed
Ruff check fixes
1 parent 7dda9e3 commit 88b8a36

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

tests/test_aioca_cs.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,15 @@
33
from unittest.mock import MagicMock, patch
44

55
import pytest
6-
from constants import RB_PV, SP_PV
76
from testfixtures import LogCapture
87

98
import pytac
9+
from constants import RB_PV, SP_PV
1010
from pytac.aioca_cs import AIOCAControlSystem
1111

1212

13-
<<<<<<< Updated upstream
14-
class CANothing(Exception):
15-
"""A minimal mock of the cothread CANothing exception class."""
16-
=======
1713
class CANothing(Exception): # noqa: N818
1814
"""A minimal mock of the aioca CANothing exception class."""
19-
>>>>>>> Stashed changes
2015

2116
def __init__(self, name, errorcode=True):
2217
self.ok = errorcode
@@ -70,7 +65,7 @@ async def test_set_multiple_calls_caput_correctly(caput: MagicMock, cs):
7065

7166
@patch("pytac.aioca_cs.caget")
7267
@patch("pytac.aioca_cs.CANothing", CANothing)
73-
async def test_get_multiple_raises_ControlSystemException(caget: MagicMock, cs):
68+
async def test_get_multiple_raises_control_system_exception(caget: MagicMock, cs):
7469
"""Here we check that errors are thrown, suppressed and logged correctly."""
7570
caget.return_value = [12, CANothing("pv", False)]
7671
with pytest.raises(pytac.exceptions.ControlSystemException):
@@ -82,7 +77,7 @@ async def test_get_multiple_raises_ControlSystemException(caget: MagicMock, cs):
8277

8378
@patch("pytac.aioca_cs.caput")
8479
@patch("pytac.aioca_cs.CANothing", CANothing)
85-
async def test_set_multiple_raises_ControlSystemException(caput: MagicMock, cs):
80+
async def test_set_multiple_raises_control_system_exception(caput: MagicMock, cs):
8681
"""Here we check that errors are thrown, suppressed and logged correctly."""
8782
caput.return_value = [CANothing("pv1", True), CANothing("pv2", False)]
8883
with pytest.raises(pytac.exceptions.ControlSystemException):
@@ -97,7 +92,7 @@ async def test_set_multiple_raises_ControlSystemException(caput: MagicMock, cs):
9792

9893
@patch("pytac.aioca_cs.caget")
9994
@patch("pytac.aioca_cs.CANothing", CANothing)
100-
async def test_get_single_raises_ControlSystemException(caget: MagicMock, cs):
95+
async def test_get_single_raises_control_system_exception(caget: MagicMock, cs):
10196
"""Here we check that errors are thrown, suppressed and logged correctly."""
10297
caget.side_effect = CANothing("pv", False)
10398
with LogCapture() as log:
@@ -109,7 +104,7 @@ async def test_get_single_raises_ControlSystemException(caget: MagicMock, cs):
109104

110105
@patch("pytac.aioca_cs.caput")
111106
@patch("pytac.aioca_cs.CANothing", CANothing)
112-
async def test_set_single_raises_ControlSystemException(caput: MagicMock, cs):
107+
async def test_set_single_raises_control_system_exception(caput: MagicMock, cs):
113108
"""Here we check that errors are thrown, suppressed and logged correctly."""
114109
caput.side_effect = CANothing("pv", False)
115110
with LogCapture() as log:
@@ -119,7 +114,7 @@ async def test_set_single_raises_ControlSystemException(caput: MagicMock, cs):
119114
log.check(("root", "WARNING", "Cannot connect to prefix:sp."))
120115

121116

122-
async def test_set_multiple_raises_ValueError_on_input_length_mismatch(cs):
117+
async def test_set_multiple_raises_value_error_on_input_length_mismatch(cs):
123118
with pytest.raises(ValueError):
124119
await cs.set_multiple([SP_PV], [42, 6])
125120
with pytest.raises(ValueError):

0 commit comments

Comments
 (0)