3232]
3333
3434
35- @pytest .fixture
36- def sut_minimal ():
35+ @pytest .fixture ( name = "sut_minimal" )
36+ def sut_minimal_fixture ():
3737 aero_data = ppmc .AeroData (AERO_DATA_CTOR_ARG_MINIMAL )
3838 sut = ppmc .AeroDist (aero_data , AERO_DIST_CTOR_ARG_MINIMAL )
3939 aero_data = None
@@ -113,9 +113,7 @@ def test_ctor_modes_in_order(n_modes=4):
113113
114114 @staticmethod
115115 @pytest .mark .parametrize ("idx" , (- 1 , 500 ))
116- def test_get_mode_out_of_range (
117- sut_minimal , idx
118- ): # pylint: disable=redefined-outer-name
116+ def test_get_mode_out_of_range (sut_minimal , idx ):
119117 # act
120118 try :
121119 _ = sut_minimal .mode (idx )
@@ -128,7 +126,7 @@ def test_get_mode_out_of_range(
128126 @staticmethod
129127 def test_get_mode_result_lifetime (
130128 sut_minimal ,
131- ): # pylint: disable=redefined-outer-name
129+ ):
132130 # arrange
133131 mode = sut_minimal .mode (0 )
134132 mode_type = mode .type
@@ -141,7 +139,7 @@ def test_get_mode_result_lifetime(
141139 assert mode .type == mode_type
142140
143141 @staticmethod
144- def test_get_mode_is_a_copy (sut_minimal ): # pylint: disable=redefined-outer-name
142+ def test_get_mode_is_a_copy (sut_minimal ):
145143 # arrange
146144 new_type = "mono"
147145 mode_idx = 0
@@ -153,3 +151,15 @@ def test_get_mode_is_a_copy(sut_minimal): # pylint: disable=redefined-outer-nam
153151
154152 # assert
155153 assert sut_minimal .mode (mode_idx ).type != new_type
154+
155+ @staticmethod
156+ def test_ctor_multimode_error_on_repeated_mode_names ():
157+ # arrange
158+ aero_data = ppmc .AeroData (AERO_DATA_CTOR_ARG_MINIMAL )
159+
160+ # act
161+ with pytest .raises (Exception ) as exc_info :
162+ ppmc .AeroDist (aero_data , AERO_DIST_CTOR_ARG_MINIMAL * 2 )
163+
164+ # assert
165+ assert str (exc_info .value ) == "Mode names must be unique"
0 commit comments