Skip to content

Commit 18a7620

Browse files
committed
Cover exceptions in examples
1 parent 53d2a1b commit 18a7620

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/sage/matroids/database_collections.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,33 @@ def AllMatroids(n, r=None, type="all"):
7676
paving_n04_r03_#1: Matroid of rank 3 on 4 elements with 3 bases
7777
paving_n04_r04_#0: Matroid of rank 4 on 4 elements with 1 bases
7878
79+
::
80+
81+
sage: for M in matroids.AllMatroids(10, 4):
82+
....: M
83+
Traceback (most recent call last):
84+
...
85+
FileNotFoundError: (n=10, r=4, type="all") is not available in the
86+
database
87+
sage: for M in matroids.AllMatroids(12, 3, "unorientable"):
88+
....: M
89+
Traceback (most recent call last):
90+
...
91+
FileNotFoundError: (n=12, r=3, type="unorientable") is not available
92+
in the database
93+
sage: for M in matroids.AllMatroids(8, type="unorientable"):
94+
....: M
95+
Traceback (most recent call last):
96+
...
97+
ValueError: The rank needs to be specified for type "unorientable".
98+
Available: (n=7-11, r=3), (n=7-9, r=4).
99+
sage: for M in matroids.AllMatroids(6, type="nice"):
100+
....: M
101+
Traceback (most recent call last):
102+
...
103+
AttributeError: The type "nice" is not available. There needs to be an
104+
"is_nice()" attribute for the type to be supported.
105+
79106
REFERENCES:
80107
81108
The underlying database was retrieved from Yoshitake Matsumoto's Database

0 commit comments

Comments
 (0)