Skip to content

Commit e67a8e0

Browse files
committed
test: add doctests in separate CI job
1 parent cc35a53 commit e67a8e0

File tree

4 files changed

+50
-6
lines changed

4 files changed

+50
-6
lines changed

.github/workflows/buildwheel.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,25 @@ jobs:
7777
path: wheelhouse
7878
- run: pip install --find-links wheelhouse python_flint
7979
- run: python test/test.py
80+
81+
doctest_wheels:
82+
needs: build_wheels
83+
name: Doctests for ${{ matrix.python-version }} wheel on ${{ matrix.os }}
84+
runs-on: ${{ matrix.os }}
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
os: [ubuntu-20.04, windows-2019, macos-12]
89+
python-version: ['3.9', '3.10', '3.11']
90+
91+
steps:
92+
- uses: actions/checkout@v3
93+
- uses: actions/setup-python@v4
94+
with:
95+
python-version: ${{ matrix.python-version }}
96+
- uses: actions/download-artifact@v3
97+
with:
98+
name: artifact
99+
path: wheelhouse
100+
- run: pip install --find-links wheelhouse python_flint
101+
- run: python test/dtest.py

bin/build_dependencies_unix.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,13 @@ cd arb-$ARBVER
177177
--disable-static
178178
make -j3
179179
make install
180+
#
181+
# Here make check passes for Linux and OSX but fails for Windows probably
182+
# because of a linker error or something like that. It would be nice to
183+
# enable this check when it can work for Windows but for now we disable it
184+
# because if it fails then we don't get any wheels built.
185+
#
186+
# ARB_TEST_MULTIPLIER=0.1 make check
180187
cd ..
181188

182189
# ------------------------------------------------------------------------- #

test/dtest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import sys
2+
import doctest
3+
import flint
4+
5+
sys.stdout.write("doctests...");
6+
fail, total = doctest.testmod(flint._flint);
7+
if fail == 0:
8+
print("OK")
9+
else:
10+
raise AssertionError("%i of %i doctests failed" % (fail, total))

test/test.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,14 @@ def test_arb():
446446
sys.stdout.write("test_nmod_poly..."); test_nmod_poly(); print("OK")
447447
sys.stdout.write("test_nmod_mat..."); test_nmod_mat(); print("OK")
448448
sys.stdout.write("test_arb.."); test_arb(); print("OK")
449-
sys.stdout.write("doctests...");
450-
fail, total = doctest.testmod(flint._flint);
451-
if fail == 0:
452-
print("OK")
453-
else:
454-
raise AssertionError("%i of %i doctests failed" % (fail, total))
449+
print("OK")
450+
#
451+
# The doctests currently fail on Windows so for now we separate them into a
452+
# separate test/doctest.py.
453+
#
454+
#sys.stdout.write("doctests...");
455+
#fail, total = doctest.testmod(flint._flint);
456+
#if fail == 0:
457+
# print("OK")
458+
#else:
459+
# raise AssertionError("%i of %i doctests failed" % (fail, total))

0 commit comments

Comments
 (0)