Skip to content

Commit dcd0705

Browse files
committed
add return types to instance methods in test_sequences
1 parent cbc5bcb commit dcd0705

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

tests/test_sequences.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ class TestThermodynamicRelationships(unittest.TestCase):
161161
different types of DNA structures and sequences.
162162
'''
163163

164-
def setUp(self):
164+
def setUp(self) -> None:
165165
self.conditions = STANDARD_CONDITIONS.copy()
166166
self.thermo = thermoanalysis.ThermoAnalysis()
167167
self.thermo.set_thermo_args(**self.conditions)
168168

169-
def test_gc_content_effect(self):
169+
def test_gc_content_effect(self) -> None:
170170
'''Test that GC-rich sequences have higher melting temperatures than
171171
AT-rich ones
172172
'''
@@ -178,7 +178,7 @@ def test_gc_content_effect(self):
178178

179179
self.assertGreater(gc_tm, at_tm)
180180

181-
def test_hairpin_stability(self):
181+
def test_hairpin_stability(self) -> None:
182182
'''Test that perfect hairpins are more stable than mismatched ones'''
183183
perfect = TEST_SEQUENCES['hairpins']['perfect']
184184
mismatched = TEST_SEQUENCES['hairpins']['mismatched']
@@ -188,7 +188,7 @@ def test_hairpin_stability(self):
188188

189189
self.assertLess(perfect_dg, mismatched_dg)
190190

191-
def test_hairpin_stability_relationships(self):
191+
def test_hairpin_stability_relationships(self) -> None:
192192
'''Test that hairpin stabilities follow expected order: perfect <
193193
mismatched < bulged.
194194
'''
@@ -203,7 +203,7 @@ def test_hairpin_stability_relationships(self):
203203
self.assertLess(perfect_dg, mismatched_dg)
204204
self.assertLess(mismatched_dg, bulged_dg)
205205

206-
def test_heterodimer_stability_relationships(self):
206+
def test_heterodimer_stability_relationships(self) -> None:
207207
'''Test that heterodimer stabilities follow expected order:
208208
complementary < overlapping < mismatched.
209209
'''
@@ -224,7 +224,7 @@ def test_heterodimer_stability_relationships(self):
224224
self.assertLess(comp_dg, overlap_dg)
225225
self.assertLess(overlap_dg, mismatch_dg)
226226

227-
def test_end_stability_relationships(self):
227+
def test_end_stability_relationships(self) -> None:
228228
'''Test that end stability follows expected order: perfect < partial <
229229
mismatched.
230230
'''
@@ -245,7 +245,7 @@ def test_end_stability_relationships(self):
245245
self.assertLess(perfect_dg, partial_dg)
246246
self.assertLess(partial_dg, mismatched_dg)
247247

248-
def test_parameter_effects(self):
248+
def test_parameter_effects(self) -> None:
249249
'''Test that changing parameters affects all sequences consistently'''
250250
base_conditions = self.conditions.copy()
251251
high_salt_conditions = base_conditions.copy()
@@ -270,36 +270,36 @@ class TestThermodynamicRegression(unittest.TestCase):
270270
previously calculated across different types of DNA structures.
271271
'''
272272

273-
def setUp(self):
273+
def setUp(self) -> None:
274274
self.conditions = STANDARD_CONDITIONS.copy()
275275
self.thermo = thermoanalysis.ThermoAnalysis()
276276
self.thermo.set_thermo_args(**self.conditions)
277277
self.standard_values = load_thermo_values()['values']
278278

279-
def assert_thermo_result_equal(self, result1, result2, places=2):
279+
def assert_thermo_result_equal(self, result1, result2, places=2) -> None:
280280
'''Assert that two thermodynamic results are approximately equal'''
281281
for key, value in result1.items():
282282
if isinstance(value, (int, float)):
283283
self.assertAlmostEqual(value, result2[key], places=places)
284284
elif isinstance(value, dict):
285285
self.assert_thermo_result_equal(value, result2[key], places)
286286

287-
def test_hairpin_regression(self):
287+
def test_hairpin_regression(self) -> None:
288288
'''Test that hairpin calculations match standard values'''
289289
for name, seq in TEST_SEQUENCES['hairpins'].items():
290290
result = self.thermo.calc_hairpin(seq).todict()
291291
standard = self.standard_values['hairpins'][name]['hairpin']
292292
self.assert_thermo_result_equal(result, standard)
293293

294-
def test_homodimer_regression(self):
294+
def test_homodimer_regression(self) -> None:
295295
'''Test that homodimer calculations match standard values'''
296296
for category in ['homopolymers', 'palindromes', 'hairpins']:
297297
for name, seq in TEST_SEQUENCES[category].items():
298298
result = self.thermo.calc_homodimer(seq).todict()
299299
standard = self.standard_values[category][name]['homodimer']
300300
self.assert_thermo_result_equal(result, standard)
301301

302-
def test_heterodimer_regression(self):
302+
def test_heterodimer_regression(self) -> None:
303303
'''Test that heterodimer calculations match standard values'''
304304
for name, pair in TEST_SEQUENCES['heterodimers'].items():
305305
result = self.thermo.calc_heterodimer(
@@ -308,7 +308,7 @@ def test_heterodimer_regression(self):
308308
standard = self.standard_values['heterodimers'][name]['heterodimer']
309309
self.assert_thermo_result_equal(result, standard)
310310

311-
def test_end_stability_regression(self):
311+
def test_end_stability_regression(self) -> None:
312312
'''Test that end stability calculations match standard values'''
313313
for name, pair in TEST_SEQUENCES['end_stability'].items():
314314
result = self.thermo.calc_end_stability(

0 commit comments

Comments
 (0)