Skip to content

Commit 54ffdf5

Browse files
committed
test: Allow skipping some docstring tests based on flint version
1 parent e47b2a3 commit 54ffdf5

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/flint/test/test_docstrings.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55

66
import flint
77

8-
dunder_test_regex = re.compile(r'^(.*?)__test__\..*?\.(.*) \(line (\d+)\)$')
8+
dunder_test_regex = re.compile(r'^(.*?)__test__\.(.*?\.)(.*) \(line (\d+)\)$')
9+
10+
test_flint_at_least = {
11+
"flint.types._gr.gr_ctx.neg": 30100,
12+
}
913

1014

1115
def find_doctests(module):
@@ -20,9 +24,14 @@ def find_doctests(module):
2024
m = dunder_test_regex.match(test.name)
2125
if m is not None:
2226
groups = m.groups()
23-
test.name = groups[0] + groups[1]
24-
test.lineno = int(groups[2])
25-
res.append(test)
27+
test.name = groups[0] + groups[2]
28+
test.lineno = int(groups[3])
29+
30+
if (
31+
test_flint_at_least.get("".join(groups[:3]), flint.__FLINT_RELEASE__)
32+
<= flint.__FLINT_RELEASE__
33+
):
34+
res.append(test)
2635

2736
tests.append((module_info.name, res))
2837

0 commit comments

Comments
 (0)