Skip to content

Commit

Permalink
Check warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mobiusklein committed Dec 1, 2023
1 parent 351b8d7 commit d8095b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_mgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ def test_write_single(self):
mgf.write(spectra=spectrum, output=tmpfile)

self.assertGreaterEqual(len(ws), 2)
n_warned = 0
for w in ws:
self.assertTrue(issubclass(w.category, UserWarning))
self.assertTrue("discouraged" in str(w.message))
n_warned += (issubclass(w.category, UserWarning) and "discouraged" in str(w.message))
self.assertGreaterEqual(n_warned, 2)
tmpfile.seek(0)
tmpreader = mgf.read(tmpfile)
self.assertEqual(data.mgf_spectra_long, list(tmpreader))
Expand Down

0 comments on commit d8095b8

Please sign in to comment.