Skip to content

Commit 5642ba3

Browse files
TST: fix typos in tests
1 parent 5016fbd commit 5642ba3

File tree

6 files changed

+64
-39
lines changed

6 files changed

+64
-39
lines changed

tests/conftest.py

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,52 @@
1-
from gearpy.mechanical_objects import SpurGear, HelicalGear, DCMotor, Flywheel, MatingMaster, MatingSlave, WormGear, WormWheel
1+
from gearpy.mechanical_objects import (
2+
SpurGear,
3+
HelicalGear,
4+
DCMotor,
5+
Flywheel,
6+
MatingMaster,
7+
MatingSlave,
8+
WormGear,
9+
WormWheel
10+
)
211
from gearpy.mechanical_objects.mechanical_object_base import (
3-
WORM_GEAR_AND_WHEEL_AVAILABLE_PRESSURE_ANGLES,
4-
WORM_GEAR_AND_WHEEL_DATA
12+
WORM_GEAR_AND_WHEEL_AVAILABLE_PRESSURE_ANGLES,
13+
WORM_GEAR_AND_WHEEL_DATA
514
)
615
from gearpy.sensors import (
7-
AbsoluteRotaryEncoder,
8-
Amperometer,
9-
Tachometer,
10-
Timer
16+
AbsoluteRotaryEncoder,
17+
Amperometer,
18+
Tachometer,
19+
Timer
1120
)
1221
from gearpy.solver import Solver
1322
from gearpy.powertrain import Powertrain
1423
from gearpy.units import (
15-
AngularAcceleration,
16-
AngularPosition,
17-
AngularSpeed,
18-
Current,
19-
Force,
20-
InertiaMoment,
21-
Length,
22-
Stress,
23-
Surface,
24-
Time,
25-
TimeInterval,
26-
Torque,
27-
Angle
24+
AngularAcceleration,
25+
AngularPosition,
26+
AngularSpeed,
27+
Current,
28+
Force,
29+
InertiaMoment,
30+
Length,
31+
Stress,
32+
Surface,
33+
Time,
34+
TimeInterval,
35+
Torque,
36+
Angle
2837
)
2938
from gearpy.utils import add_fixed_joint, add_gear_mating, add_worm_gear_mating
3039
from hypothesis.strategies import (
31-
composite,
32-
text,
33-
integers,
34-
floats,
35-
lists,
36-
sampled_from,
37-
shared,
38-
builds,
39-
characters,
40-
one_of
40+
composite,
41+
text,
42+
integers,
43+
floats,
44+
lists,
45+
sampled_from,
46+
shared,
47+
builds,
48+
characters,
49+
one_of
4150
)
4251
import numpy as np
4352
import os
@@ -469,7 +478,7 @@ def worm_wheels(draw, structural=False, pressure_angle=None):
469478
n_teeth=n_teeth,
470479
inertia_moment=InertiaMoment(inertia_moment_value, 'kgm^2'),
471480
pressure_angle=pressure_angle,
472-
helix_angle = Angle(helix_angle_value, 'deg'),
481+
helix_angle=Angle(helix_angle_value, 'deg'),
473482
module=Length(module_value, 'mm'),
474483
face_width=Length(face_width_value, 'mm')
475484
)

tests/test_powertrain/test_powertrain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,4 +570,4 @@ def test_raises_type_error(
570570
@mark.error
571571
def test_raises_value_error(self):
572572
with raises(ValueError):
573-
basic_powertrain.export_time_variables(folder_path = '')
573+
basic_powertrain.export_time_variables(folder_path='')

tests/test_units/test_angle/test_angle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ def test_method(self, value_1, unit_1, value_2, unit_2):
140140
assert result_1.value == angle_1.value + angle_2.to(unit_1).value
141141
assert result_1.unit == angle_1.unit
142142
assert isinstance(result_2, AngularPosition)
143-
assert result_2.value == angle_1.value + angular_position.to(unit_1).value
143+
assert result_2.value == angle_1.value + \
144+
angular_position.to(unit_1).value
144145
assert result_2.unit == angle_1.unit
145146

146147
@mark.error

tests/test_units/test_inertia_moment/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,9 @@ def inertia_moment_le_type_error(request):
174174
if not isinstance(type_to_check, int | bool)
175175
]
176176

177+
177178
@fixture(
178-
params=[*inertia_moment_to_type_error_1,*inertia_moment_to_type_error_2]
179+
params=[*inertia_moment_to_type_error_1, *inertia_moment_to_type_error_2]
179180
)
180181
def inertia_moment_to_type_error(request):
181182
return request.param

tests/test_utils/conftest.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
from gearpy.mechanical_objects import RotatingObject, GearBase, MotorBase, DCMotor, SpurGear, HelicalGear, WormGear, \
2-
WormWheel
1+
from gearpy.mechanical_objects import (
2+
RotatingObject,
3+
GearBase,
4+
MotorBase,
5+
DCMotor,
6+
SpurGear,
7+
HelicalGear,
8+
WormGear,
9+
WormWheel
10+
)
311
from gearpy.motor_control import PWMControl
412
from gearpy.motor_control.rules import ReachAngularPosition
513
from gearpy.sensors import AbsoluteRotaryEncoder
@@ -484,7 +492,7 @@ def add_fixed_joint_type_error(request):
484492
@fixture(
485493
params=[
486494
*dc_motor_characteristics_animation_type_error_1,
487-
dc_motor_characteristics_animation_type_error_2,
495+
*dc_motor_characteristics_animation_type_error_2,
488496
*dc_motor_characteristics_animation_type_error_3,
489497
*dc_motor_characteristics_animation_type_error_4,
490498
*dc_motor_characteristics_animation_type_error_5,

tests/test_utils/test_utils.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,20 @@ def call_animation(
334334
)
335335

336336
@mark.error
337-
def test_raises_type_error(self, dc_motor_characteristics_animation_type_error):
337+
def test_raises_type_error(
338+
self,
339+
dc_motor_characteristics_animation_type_error
340+
):
338341
with raises(TypeError):
339342
dc_motor_characteristics_animation(
340343
**dc_motor_characteristics_animation_type_error
341344
)
342345

343346
@mark.error
344-
def test_raises_value_error(self, dc_motor_characteristics_animation_value_error):
347+
def test_raises_value_error(
348+
self,
349+
dc_motor_characteristics_animation_value_error
350+
):
345351
with raises(ValueError):
346352
dc_motor_characteristics_animation(
347353
**dc_motor_characteristics_animation_value_error

0 commit comments

Comments
 (0)