@@ -46,7 +46,9 @@ def _generate(self):
4646
4747 def _cross_section (self , kin ):
4848 self ._lib .crranma4 .ntot += 1
49- return CrossSectionData (inelastic = float (self ._lib .crranma4 .ntot ))
49+ if self .raise_at is not None :
50+ raise ValueError ("from raise_at" )
51+ return CrossSectionData (inelastic = float (self ._lib .crranma4 .ntot [0 ]))
5052
5153 def _set_kinematics (self , kin ):
5254 self ._kin = kin
@@ -78,7 +80,8 @@ def test_dummy_1(timeout):
7880 assert model .random_state .counter == 5
7981
8082 c = model .cross_section (kin )
81- assert c .inelastic == 5
83+ assert c .inelastic == 6
84+ assert model .random_state .counter == 6
8285
8386
8487@pytest .mark .parametrize ("timeout" , (100 , 0 ))
@@ -121,6 +124,12 @@ def test_dummy_3(timeout):
121124 assert events == expected
122125
123126 assert model .random_state .counter >= 3
127+ prev = int (model .random_state .counter )
128+
129+ with pytest .raises (ValueError ):
130+ model .cross_section (kin )
131+
132+ assert model .random_state .counter == prev + 1
124133
125134
126135@pytest .mark .parametrize ("timeout" , (100 , 0 ))
0 commit comments