Skip to content

Commit 33e5485

Browse files
Merge pull request #103 from oscarbenjamin/pr_good
Export good and ensure all tests run
2 parents 9252d17 + 5333f75 commit 33e5485

File tree

5 files changed

+37
-4
lines changed

5 files changed

+37
-4
lines changed

.github/workflows/buildwheel.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,28 @@ jobs:
7575
with:
7676
path: dist/*.tar.gz
7777

78+
test_rst:
79+
needs: build_wheels
80+
name: Test rst docs
81+
runs-on: ubuntu-20.04
82+
83+
steps:
84+
- uses: actions/checkout@v3
85+
86+
- uses: actions/setup-python@v4
87+
with:
88+
python-version: '3.12'
89+
90+
- uses: actions/download-artifact@v3
91+
with:
92+
name: artifact
93+
path: wheelhouse
94+
95+
- run: pip install --upgrade pip
96+
- run: pip install pytest
97+
- run: pip install --no-index --find-links wheelhouse python_flint
98+
- run: pytest --doctest-glob='*.rst' doc/source
99+
78100
test_wheels:
79101
needs: build_wheels
80102
name: Test ${{ matrix.python-version }} wheel on ${{ matrix.os }}

doc/source/general.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ The user can mutate the properties directly, for example::
4646
>>> fmpq(3,2)
4747
fmpq(3,2)
4848
>>> ctx.pretty = True
49+
>>> fmpq(3,2)
4950
3/2
5051

5152
Calling ``ctx.default()`` restores the default settings.

src/flint/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
from .types.fmpz_mod import *
2525
from .types.fmpz_mod_poly import *
2626
from .types.dirichlet import *
27-
from .functions.showgood import showgood
27+
from .functions.showgood import good, showgood
2828

2929
__version__ = '0.5.0'

src/flint/flint_base/flint_context.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ cdef class FlintContext:
6363
"prec = %-8s # real/complex precision (in bits)\n" \
6464
"dps = %-8s # real/complex precision (in digits)\n" \
6565
"cap = %-8s # power series precision\n" \
66-
"threads = %-8s # max number of threads used internally\n" % \
66+
"threads = %-8s # max number of threads used internally" % \
6767
(self.pretty, self.unicode, self.prec, self.dps, self.cap, self.threads)
6868

6969
def cleanup(self):

src/flint/test/test.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def raises(f, exception):
3030
prec = 53 # real/complex precision (in bits)
3131
dps = 15 # real/complex precision (in digits)
3232
cap = 10 # power series precision
33-
threads = 1 # max number of threads used internally
33+
threads = 1 # max number of threads used internally\
3434
"""
3535

3636
def test_pyflint():
@@ -78,6 +78,9 @@ def test_pyflint():
7878
assert raises(lambda: setattr(ctx, "prec", -1), ValueError)
7979
assert raises(lambda: setattr(ctx, "dps", -1), ValueError)
8080

81+
def test_showgood():
82+
from flint import good, showgood
83+
8184
def test_fmpz():
8285
assert flint.fmpz() == flint.fmpz(0)
8386
L = [0, 1, 2, 3, 2**31-1, 2**31, 2**63-1, 2**63, 2**64-1, 2**64]
@@ -2422,10 +2425,14 @@ def setbad(obj, i, val):
24222425
if is_field:
24232426
assert P([1, 2, 1]).integral() == P([0, 1, 1, S(1)/3])
24242427

2425-
2428+
def test_all_tests():
2429+
test_funcs = {f for name, f in globals().items() if name.startswith("test_")}
2430+
untested = test_funcs - set(all_tests)
2431+
assert not untested, f"Untested functions: {untested}"
24262432

24272433
all_tests = [
24282434
test_pyflint,
2435+
test_showgood,
24292436
test_fmpz,
24302437
test_fmpz_factor,
24312438
test_fmpz_functions,
@@ -2441,9 +2448,12 @@ def setbad(obj, i, val):
24412448
test_nmod,
24422449
test_nmod_poly,
24432450
test_nmod_mat,
2451+
test_nmod_series,
24442452
test_arb,
24452453
test_fmpz_mod,
24462454
test_fmpz_mod_dlog,
24472455
test_fmpz_mod_poly,
24482456
test_polys,
2457+
test_pickling,
2458+
test_all_tests,
24492459
]

0 commit comments

Comments
 (0)