Skip to content

Commit 9555063

Browse files
pytest: Fix bad pytest.raises
1 parent e813409 commit 9555063

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

tests/test_presentation_examples.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from libsemigroups_pybind11 import (
1616
POSITIVE_INFINITY,
1717
LibsemigroupsError,
18+
Presentation,
1819
ReportGuard,
1920
ToddCoxeter,
2021
congruence_kind,
@@ -254,6 +255,8 @@ def test_rectangular_band_ACOR00():
254255
ReportGuard(False)
255256
with pytest.raises(LibsemigroupsError):
256257
examples.rectangular_band_ACOR00(1, 0)
258+
259+
with pytest.raises(LibsemigroupsError):
257260
examples.rectangular_band_ACOR00(0, 1)
258261

259262
p = examples.rectangular_band_ACOR00(4, 5)
@@ -269,6 +272,8 @@ def test_stellar_monoid_GH19():
269272
ReportGuard(False)
270273
with pytest.raises(LibsemigroupsError):
271274
examples.stellar_monoid_GH19(0)
275+
276+
with pytest.raises(LibsemigroupsError):
272277
examples.stellar_monoid_GH19(1)
273278

274279
# TODO(1) adapt for new Sims API
@@ -282,6 +287,8 @@ def test_chinese_monoid_CEKNH01():
282287
ReportGuard(False)
283288
with pytest.raises(LibsemigroupsError):
284289
examples.chinese_monoid_CEKNH01(0)
290+
291+
with pytest.raises(LibsemigroupsError):
285292
examples.chinese_monoid_CEKNH01(1)
286293

287294
# TODO(1) adapt for new Sims API
@@ -296,6 +303,8 @@ def test_monogenic_semigroup():
296303
ReportGuard(False)
297304
with pytest.raises(LibsemigroupsError):
298305
examples.monogenic_semigroup(4, 0)
306+
307+
with pytest.raises(LibsemigroupsError):
299308
examples.monogenic_semigroup(0, 0)
300309

301310
p = examples.monogenic_semigroup(5, 9)
@@ -307,7 +316,8 @@ def test_plactic_monoid_Knu70():
307316
ReportGuard(False)
308317
with pytest.raises(LibsemigroupsError):
309318
examples.plactic_monoid_Knu70(0)
310-
examples.plactic_monoid_Knu70(1)
319+
320+
assert examples.plactic_monoid_Knu70(1) == Presentation([0])
311321

312322
# TODO(1) adapt for new Sims API
313323
# p = examples.plactic_monoid_Knu70(4)
@@ -321,6 +331,8 @@ def test_stylic_monoid_AR22():
321331
ReportGuard(False)
322332
with pytest.raises(LibsemigroupsError):
323333
examples.stylic_monoid_AR22(0)
334+
335+
with pytest.raises(LibsemigroupsError):
324336
examples.stylic_monoid_AR22(1)
325337

326338
# TODO(1) adapt for new Sims API
@@ -335,7 +347,11 @@ def test_fibonacci_semigroup_CRRT94():
335347
ReportGuard(False)
336348
with pytest.raises(LibsemigroupsError):
337349
examples.fibonacci_semigroup_CRRT94(0, 1)
350+
351+
with pytest.raises(LibsemigroupsError):
338352
examples.fibonacci_semigroup_CRRT94(1, 0)
353+
354+
with pytest.raises(LibsemigroupsError):
339355
examples.fibonacci_semigroup_CRRT94(0, 0)
340356

341357
p = examples.fibonacci_semigroup_CRRT94(2, 5)
@@ -347,7 +363,11 @@ def test_temperley_lieb_monoid_Eas21():
347363
ReportGuard(False)
348364
with pytest.raises(LibsemigroupsError):
349365
examples.temperley_lieb_monoid_Eas21(0)
366+
367+
with pytest.raises(LibsemigroupsError):
350368
examples.temperley_lieb_monoid_Eas21(1)
369+
370+
with pytest.raises(LibsemigroupsError):
351371
examples.temperley_lieb_monoid_Eas21(2)
352372

353373
p = examples.temperley_lieb_monoid_Eas21(8)
@@ -359,7 +379,11 @@ def test_singular_brauer_monoid_MM07():
359379
ReportGuard(False)
360380
with pytest.raises(LibsemigroupsError):
361381
examples.singular_brauer_monoid_MM07(0)
382+
383+
with pytest.raises(LibsemigroupsError):
362384
examples.singular_brauer_monoid_MM07(1)
385+
386+
with pytest.raises(LibsemigroupsError):
363387
examples.singular_brauer_monoid_MM07(2)
364388

365389
p = examples.singular_brauer_monoid(6)
@@ -371,7 +395,11 @@ def test_orientation_preserving_monoid_AR00():
371395
ReportGuard(False)
372396
with pytest.raises(LibsemigroupsError):
373397
examples.orientation_preserving_monoid_AR00(0)
398+
399+
with pytest.raises(LibsemigroupsError):
374400
examples.orientation_preserving_monoid_AR00(1)
401+
402+
with pytest.raises(LibsemigroupsError):
375403
examples.orientation_preserving_monoid_AR00(2)
376404

377405
p = examples.orientation_preserving_monoid_AR00(6)
@@ -383,7 +411,11 @@ def test_orientation_preserving_reversing_monoid_AR00():
383411
ReportGuard(False)
384412
with pytest.raises(LibsemigroupsError):
385413
examples.orientation_preserving_reversing_monoid_AR00(0)
414+
415+
with pytest.raises(LibsemigroupsError):
386416
examples.orientation_preserving_reversing_monoid_AR00(1)
417+
418+
with pytest.raises(LibsemigroupsError):
387419
examples.orientation_preserving_reversing_monoid_AR00(2)
388420

389421
p = examples.orientation_preserving_reversing_monoid_AR00(5)

0 commit comments

Comments
 (0)