From 2aa9e4ec6030b927d011bb0ac94c74a6a5962940 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 23 Sep 2025 21:08:52 -0400 Subject: [PATCH 01/14] sage.rings.valuation.mapped_valuation_test: add pytests Copy two TestSuite() runs from a TESTS:: block to pytest. These are on the verge of hitting the "slow doctest" limit for long tests, and sometimes cause warnings in the CI. But more importantly, they are simply better suited to pytest: the user would never want to run them, and the output is not meaningful as documentation. --- .../rings/valuation/mapped_valuation_test.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/sage/rings/valuation/mapped_valuation_test.py diff --git a/src/sage/rings/valuation/mapped_valuation_test.py b/src/sage/rings/valuation/mapped_valuation_test.py new file mode 100644 index 00000000000..999398d8861 --- /dev/null +++ b/src/sage/rings/valuation/mapped_valuation_test.py @@ -0,0 +1,27 @@ +import pytest + + +def test_finite_extension_from_limit_valuation(): + r""" + Run the ``TestSuite()`` for two examples given in the + ``FiniteExtensionFromLimitValuation`` documentation. + """ + from sage.misc.sage_unittest import TestSuite + from sage.rings.function_field.constructor import FunctionField + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + from sage.rings.integer import Integer + from sage.rings.rational_field import QQ + + K = FunctionField(QQ, 'x') + x = K.gen() + R = PolynomialRing(K, 'y') + y = R.gen() + L = K.extension(y**2 - x) + v = K.valuation(Integer(1)) + w = v.extensions(L) + + for ext in w: + # fewer max_runs, these are kind of slow + TestSuite(ext).run(verbose=True, + raise_on_failure=True, + max_runs=512) From 277fa29dc6e5676d64672bd8304c0d4de67cf30f Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 23 Sep 2025 21:08:36 -0400 Subject: [PATCH 02/14] src.sage.rings.valuation.mapped_valuation: drop two TestSuite() tests These have been moved to pytest and no longer need to be run as doctests. --- src/sage/rings/valuation/mapped_valuation.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/sage/rings/valuation/mapped_valuation.py b/src/sage/rings/valuation/mapped_valuation.py index 0c9dde8d423..24ecc9c89a9 100644 --- a/src/sage/rings/valuation/mapped_valuation.py +++ b/src/sage/rings/valuation/mapped_valuation.py @@ -595,10 +595,6 @@ class FiniteExtensionFromLimitValuation(FiniteExtensionFromInfiniteValuation): [[ (x - 1)-adic valuation, v(y + 1) = 1 ]-adic valuation, [ (x - 1)-adic valuation, v(y - 1) = 1 ]-adic valuation] - TESTS:: - - sage: TestSuite(w[0]).run() # long time # needs sage.rings.function_field - sage: TestSuite(w[1]).run() # long time # needs sage.rings.function_field """ def __init__(self, parent, approximant, G, approximants): r""" From 66b496fa8fc52467fd665f587d4103cb92fe09bd Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 3 Oct 2025 16:45:57 -0400 Subject: [PATCH 03/14] sage.rings.padics.padic_lattice_element_test: new pytests Move some of the TestSuite() tests from a TESTS block to pytest. These are slow, and not really meant for end-user consumption, so are more appropriate here. --- .../padics/padic_lattice_element_test.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/sage/rings/padics/padic_lattice_element_test.py diff --git a/src/sage/rings/padics/padic_lattice_element_test.py b/src/sage/rings/padics/padic_lattice_element_test.py new file mode 100644 index 00000000000..5227a558f74 --- /dev/null +++ b/src/sage/rings/padics/padic_lattice_element_test.py @@ -0,0 +1,27 @@ +import pytest +import warnings + + +def test_padic_lattice_element(): + r""" + Run the ``TestSuite()`` for some examples that previously + lived in the TESTS:: block of the padic_lattice_element module. + """ + from sage.misc.sage_unittest import TestSuite + from sage.rings.padics.factory import ZpLC, ZpLF, QpLC, QpLF + + with warnings.catch_warnings(category=FutureWarning): + warnings.filterwarnings("ignore", category=FutureWarning) + # These all raise FutureWarnings + R1 = ZpLC(2) + R2 = ZpLF(2) + R3 = QpLC(2) + R4 = QpLF(2) + + for R in (R1, R2, R3, R4): + # Only do a few runs, _test_matrix_smith() in particular is + # sloooooow. + TestSuite(R).run(verbose=True, + raise_on_failure=True, + skip="_test_teichmuller", + max_runs=8) From 09bca860cdfffd941a19cb0faf510f8b2194c3e4 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 3 Oct 2025 16:47:02 -0400 Subject: [PATCH 04/14] sage.rings.padics.padic_lattice_element: delete old TESTS Delete a few doctests that have been moved to pytest. --- src/sage/rings/padics/padic_lattice_element.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/sage/rings/padics/padic_lattice_element.py b/src/sage/rings/padics/padic_lattice_element.py index 46747174f43..19f872ac8cb 100644 --- a/src/sage/rings/padics/padic_lattice_element.py +++ b/src/sage/rings/padics/padic_lattice_element.py @@ -5,23 +5,6 @@ - Xavier Caruso (2018-02): initial version -TESTS: - -We create some rings and run the test suite for them. We skip the Smith form -tests because they take a few minutes as of mid 2018, see :issue:`25431`:: - - sage: R1 = ZpLC(2) - doctest:...: FutureWarning: This class/method/function is marked as experimental. It, its functionality or its interface might change without a formal deprecation. - See https://github.com/sagemath/sage/issues/23505 for details. - sage: R2 = ZpLF(2) - sage: R3 = QpLC(2) - sage: R4 = QpLF(2) - - sage: # long time, needs sage.rings.padics - sage: TestSuite(R1).run(skip=['_test_teichmuller', '_test_matrix_smith']) - sage: TestSuite(R2).run(skip=['_test_teichmuller', '_test_matrix_smith']) - sage: TestSuite(R3).run(skip=['_test_teichmuller', '_test_matrix_smith']) - sage: TestSuite(R4).run(skip=['_test_teichmuller', '_test_matrix_smith']) """ # **************************************************************************** From 7211af2a4ee8a9b66e771a8b8f80f52d9f326ddd Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 3 Oct 2025 16:47:43 -0400 Subject: [PATCH 05/14] sage.combinat.positive_integer_semigroup_test: new pytests Move some TestSuite tests from src/sage/combinat/backtrack.py (for the PositiveIntegerSemigroup class) to a new pytest file. These tests aren't meant for end-user consumption, and they are slow, so they are more appropriate here. --- .../combinat/positive_integer_semigroup_test.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/sage/combinat/positive_integer_semigroup_test.py diff --git a/src/sage/combinat/positive_integer_semigroup_test.py b/src/sage/combinat/positive_integer_semigroup_test.py new file mode 100644 index 00000000000..dc5471c4f59 --- /dev/null +++ b/src/sage/combinat/positive_integer_semigroup_test.py @@ -0,0 +1,16 @@ +import pytest + + +def test_positive_integer_semigroup(): + r""" + Run the ``TestSuite()`` for ``PositiveIntegerSemigroup`` + (this can take quite a long time). + """ + from sage.misc.sage_unittest import TestSuite + from sage.combinat.backtrack import PositiveIntegerSemigroup + PP = PositiveIntegerSemigroup() + + # fewer max_runs since these are kind of slow + TestSuite(PP).run(verbose=True, + raise_on_failure=True, + max_runs=256) From d5a6af0a53b9596a6866e6a280312c59fe4ae76a Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 3 Oct 2025 16:48:49 -0400 Subject: [PATCH 06/14] sage.combinat.backtrack: delete old doctest Remove a TestSuite() doctest that has been moved to pytest. --- src/sage/combinat/backtrack.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/sage/combinat/backtrack.py b/src/sage/combinat/backtrack.py index 223d3de1db5..52673e92d80 100644 --- a/src/sage/combinat/backtrack.py +++ b/src/sage/combinat/backtrack.py @@ -117,15 +117,6 @@ class PositiveIntegerSemigroup(UniqueRepresentation, RecursivelyEnumeratedSet_fo sage: some_elements = list(PP.some_elements()); some_elements [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100] - TESTS:: - - sage: from sage.combinat.backtrack import PositiveIntegerSemigroup - sage: PP = PositiveIntegerSemigroup() - - We factor out the long test from the ``TestSuite``:: - - sage: TestSuite(PP).run(skip='_test_enumerated_set_contains') - sage: PP._test_enumerated_set_contains() # long time """ def __init__(self): From 75ec8a6c7042efe72b50e33c6d3118ca41aad189 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 3 Oct 2025 19:10:29 -0400 Subject: [PATCH 07/14] sage.rings.padics.padic_lattice_element: add back FutureWarnings Shuffling around the doctests has made some FutureWarnings happen in different places. --- src/sage/rings/padics/padic_lattice_element.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sage/rings/padics/padic_lattice_element.py b/src/sage/rings/padics/padic_lattice_element.py index 19f872ac8cb..f34b7cd2844 100644 --- a/src/sage/rings/padics/padic_lattice_element.py +++ b/src/sage/rings/padics/padic_lattice_element.py @@ -48,6 +48,7 @@ def unpickle_le(parent, value, prec): sage: from sage.rings.padics.padic_lattice_element import unpickle_le sage: R = ZpLC(5,8) + doctest:...: FutureWarning:... sage: a = unpickle_le(R, 42, 6); a 2 + 3*5 + 5^2 + O(5^6) sage: a.parent() is R @@ -192,6 +193,7 @@ def _is_base_elt(self, p): EXAMPLES:: sage: K = QpLC(7) + doctest:...: FutureWarning:... sage: K.random_element()._is_base_elt(7) # not tested, known bug (see :issue:`32126`) True """ @@ -1291,6 +1293,7 @@ def _declare_new_element(self, dx, prec, dx_mode): TESTS:: sage: R = ZpLF(17) + doctest:...: FutureWarning:... sage: prec = R.precision() sage: prec.del_elements() From 82bba0d3b8e4e883ce0378ef9c418e672f95fefe Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 3 Oct 2025 20:07:27 -0400 Subject: [PATCH 08/14] src/sage/rings/padics/meson.build: add padic_lattice_element_test.py Run tools/update-meson.py to install the new pytest source file. --- src/sage/rings/padics/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sage/rings/padics/meson.build b/src/sage/rings/padics/meson.build index 4ac03767018..b85d18ca5ed 100644 --- a/src/sage/rings/padics/meson.build +++ b/src/sage/rings/padics/meson.build @@ -39,6 +39,7 @@ py.install_sources( 'padic_generic_element.pxd', 'padic_generic_element.pyx', 'padic_lattice_element.py', + 'padic_lattice_element_test.py', 'padic_printing.pxd', 'padic_printing.pyx', 'padic_relaxed_element.pxd', From b9988a73bb5debf281e45669edfec77dd7c9393d Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 3 Oct 2025 20:08:47 -0400 Subject: [PATCH 09/14] src/sage/combinat/meson.build: add positive_integer_semigroup_test.py Run tools/update-meson.py to install the new pytest source file. --- src/sage/combinat/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sage/combinat/meson.build b/src/sage/combinat/meson.build index 8d9c3233463..9ee037678c8 100644 --- a/src/sage/combinat/meson.build +++ b/src/sage/combinat/meson.build @@ -90,6 +90,7 @@ py.install_sources( 'permutation_cython.pxd', 'permutation_cython.pyx', 'plane_partition.py', + 'positive_integer_semigroup_test.py', 'q_analogues.py', 'q_bernoulli.pyx', 'quickref.py', From 0f420461b99fa1a44be5735099edbb645a313e6d Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 4 Oct 2025 09:23:25 -0400 Subject: [PATCH 10/14] sage.rings.padics.padic_lattice_element_test: parameterize tests Use parameterized tests and fixtures instead of an internal "for" loop to improve the reporting a bit. --- .../padics/padic_lattice_element_test.py | 76 ++++++++++++++----- 1 file changed, 57 insertions(+), 19 deletions(-) diff --git a/src/sage/rings/padics/padic_lattice_element_test.py b/src/sage/rings/padics/padic_lattice_element_test.py index 5227a558f74..52a374b9237 100644 --- a/src/sage/rings/padics/padic_lattice_element_test.py +++ b/src/sage/rings/padics/padic_lattice_element_test.py @@ -1,27 +1,65 @@ import pytest -import warnings -def test_padic_lattice_element(): +@pytest.fixture +def R1(): + from warnings import catch_warnings, filterwarnings + from sage.rings.padics.factory import ZpLC + with catch_warnings(category=FutureWarning): + filterwarnings("ignore", category=FutureWarning) + return ZpLC(2) + + +@pytest.fixture +def R2(): + from warnings import catch_warnings, filterwarnings + from sage.rings.padics.factory import ZpLF + with catch_warnings(category=FutureWarning): + filterwarnings("ignore", category=FutureWarning) + return ZpLF(2) + + +@pytest.fixture +def R3(): + from warnings import catch_warnings, filterwarnings + from sage.rings.padics.factory import QpLC + with catch_warnings(category=FutureWarning): + filterwarnings("ignore", category=FutureWarning) + return QpLC(2) + + +@pytest.fixture +def R4(): + from warnings import catch_warnings, filterwarnings + from sage.rings.padics.factory import QpLF + with catch_warnings(category=FutureWarning): + filterwarnings("ignore", category=FutureWarning) + return QpLF(2) + + +# Use strings for the fixture names here, and then later convert them +# to the actual fixture objects using request.getfixturevalue(). This +# is a workaround for being unable to pass fixtures directly as +# parameters: +# +# https://github.com/pytest-dev/pytest/issues/349 +# +elements = ( "R1", "R2", "R3", "R4" ) + + +@pytest.mark.parametrize("e", elements) +def test_padic_lattice_element(e, request): r""" Run the ``TestSuite()`` for some examples that previously lived in the TESTS:: block of the padic_lattice_element module. """ from sage.misc.sage_unittest import TestSuite - from sage.rings.padics.factory import ZpLC, ZpLF, QpLC, QpLF - - with warnings.catch_warnings(category=FutureWarning): - warnings.filterwarnings("ignore", category=FutureWarning) - # These all raise FutureWarnings - R1 = ZpLC(2) - R2 = ZpLF(2) - R3 = QpLC(2) - R4 = QpLF(2) - - for R in (R1, R2, R3, R4): - # Only do a few runs, _test_matrix_smith() in particular is - # sloooooow. - TestSuite(R).run(verbose=True, - raise_on_failure=True, - skip="_test_teichmuller", - max_runs=8) + + # Convert the string to a real fixture + e = request.getfixturevalue(e) + + # Only do a few runs, _test_matrix_smith() in particular is slow. + TestSuite(e).run(verbose=True, + raise_on_failure=True, + skip="_test_teichmuller", + max_runs=8) From 546c87fda220db0fccde597290ec566d354b4505 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 4 Oct 2025 09:31:17 -0400 Subject: [PATCH 11/14] sage.rings.valuation.mapped_valuation_test: parameterize tests Use parameterized tests and fixtures to improve the reporting from these tests. --- .../rings/valuation/mapped_valuation_test.py | 52 ++++++++++++++----- 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/src/sage/rings/valuation/mapped_valuation_test.py b/src/sage/rings/valuation/mapped_valuation_test.py index 999398d8861..492e93f1ec8 100644 --- a/src/sage/rings/valuation/mapped_valuation_test.py +++ b/src/sage/rings/valuation/mapped_valuation_test.py @@ -1,12 +1,8 @@ import pytest -def test_finite_extension_from_limit_valuation(): - r""" - Run the ``TestSuite()`` for two examples given in the - ``FiniteExtensionFromLimitValuation`` documentation. - """ - from sage.misc.sage_unittest import TestSuite +@pytest.fixture +def w(): from sage.rings.function_field.constructor import FunctionField from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.rings.integer import Integer @@ -18,10 +14,42 @@ def test_finite_extension_from_limit_valuation(): y = R.gen() L = K.extension(y**2 - x) v = K.valuation(Integer(1)) - w = v.extensions(L) - for ext in w: - # fewer max_runs, these are kind of slow - TestSuite(ext).run(verbose=True, - raise_on_failure=True, - max_runs=512) + return v.extensions(L) + + +@pytest.fixture +def w0(w): + return w[0] + + +@pytest.fixture +def w1(w): + return w[1] + + +# Use strings for the fixture names here, and then later convert them +# to the actual fixture objects using request.getfixturevalue(). This +# is a workaround for being unable to pass fixtures directly as +# parameters: +# +# https://github.com/pytest-dev/pytest/issues/349 +# +extensions = ( "w0", "w1" ) + + +@pytest.mark.parametrize("e", extensions) +def test_finite_extension_from_limit_valuation(e, request): + r""" + Run the ``TestSuite()`` for two examples given in the + ``FiniteExtensionFromLimitValuation`` documentation. + """ + from sage.misc.sage_unittest import TestSuite + + # Convert the string to a real fixture + e = request.getfixturevalue(e) + + # fewer max_runs, these are kind of slow + TestSuite(e).run(verbose=True, + raise_on_failure=True, + max_runs=512) From 24162b3197a126f5b0c7c2b9f95e35fff34f762f Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 4 Oct 2025 19:15:00 -0400 Subject: [PATCH 12/14] sage.misc.dev_tools.find_objects_from_name: use a copy of sys.modules In an attempt to avoid the following error on the CI... dt.find_objects_from_name('FareySymbol') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/sage/src/sage/misc/dev_tools.py", line 279, in find_objects_from_name for smodule_name, smodule in sys.modules.items(): RuntimeError: dictionary changed size during iteration we make a copy of the sys.modules dict before iterating over its items. --- src/sage/misc/dev_tools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sage/misc/dev_tools.py b/src/sage/misc/dev_tools.py index 90f41f8b0f4..531d0832b7a 100644 --- a/src/sage/misc/dev_tools.py +++ b/src/sage/misc/dev_tools.py @@ -275,8 +275,12 @@ def find_objects_from_name(name, module_name=None, include_lazy_imports=False): """ from sage.misc.lazy_import import LazyImport + # Create a copy to avoid errors if the sys.modules dict changes + # while we are iterating over it. + mods = sys.modules.copy() + obj = [] - for smodule_name, smodule in sys.modules.items(): + for smodule_name, smodule in mods.items(): if module_name and not smodule_name.startswith(module_name): continue if hasattr(smodule, '__dict__') and name in smodule.__dict__: From 73f297fc97b09a66ae599c32d24b5d0346943097 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 5 Oct 2025 11:44:39 -0400 Subject: [PATCH 13/14] sage.rings.padics.padic_lattice_element_test: improve readability Move the padic imports and FutureWarning filter to the top level, so we don't have to repeat them four times. --- .../padics/padic_lattice_element_test.py | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/src/sage/rings/padics/padic_lattice_element_test.py b/src/sage/rings/padics/padic_lattice_element_test.py index 52a374b9237..3b3095c8018 100644 --- a/src/sage/rings/padics/padic_lattice_element_test.py +++ b/src/sage/rings/padics/padic_lattice_element_test.py @@ -1,40 +1,29 @@ import pytest +from sage.rings.padics.factory import ZpLC, ZpLF, QpLC, QpLF + +# ZpLC, ZpLF, QpLC, and QpLF all raise FutureWarnings +from warnings import catch_warnings, filterwarnings +filterwarnings("ignore", category=FutureWarning) @pytest.fixture def R1(): - from warnings import catch_warnings, filterwarnings - from sage.rings.padics.factory import ZpLC - with catch_warnings(category=FutureWarning): - filterwarnings("ignore", category=FutureWarning) - return ZpLC(2) + return ZpLC(2) @pytest.fixture def R2(): - from warnings import catch_warnings, filterwarnings - from sage.rings.padics.factory import ZpLF - with catch_warnings(category=FutureWarning): - filterwarnings("ignore", category=FutureWarning) - return ZpLF(2) + return ZpLF(2) @pytest.fixture def R3(): - from warnings import catch_warnings, filterwarnings - from sage.rings.padics.factory import QpLC - with catch_warnings(category=FutureWarning): - filterwarnings("ignore", category=FutureWarning) - return QpLC(2) + return QpLC(2) @pytest.fixture def R4(): - from warnings import catch_warnings, filterwarnings - from sage.rings.padics.factory import QpLF - with catch_warnings(category=FutureWarning): - filterwarnings("ignore", category=FutureWarning) - return QpLF(2) + return QpLF(2) # Use strings for the fixture names here, and then later convert them From a424b8e3ecc226480e417c1e357a5ca81a3107af Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 8 Oct 2025 12:53:56 -0400 Subject: [PATCH 14/14] sage.rings.valuation.mapped_valuation_test: eliminate boilerplate The one test in this file is easy to parameterize based on the index (an int) of a fixture supplied to it. This allows us to eliminate a lot of the boilerplate associated with fixture parameterizations. --- .../rings/valuation/mapped_valuation_test.py | 33 +++---------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/src/sage/rings/valuation/mapped_valuation_test.py b/src/sage/rings/valuation/mapped_valuation_test.py index 492e93f1ec8..dcc8a9ba11d 100644 --- a/src/sage/rings/valuation/mapped_valuation_test.py +++ b/src/sage/rings/valuation/mapped_valuation_test.py @@ -18,38 +18,15 @@ def w(): return v.extensions(L) -@pytest.fixture -def w0(w): - return w[0] - - -@pytest.fixture -def w1(w): - return w[1] - - -# Use strings for the fixture names here, and then later convert them -# to the actual fixture objects using request.getfixturevalue(). This -# is a workaround for being unable to pass fixtures directly as -# parameters: -# -# https://github.com/pytest-dev/pytest/issues/349 -# -extensions = ( "w0", "w1" ) - - -@pytest.mark.parametrize("e", extensions) -def test_finite_extension_from_limit_valuation(e, request): +@pytest.mark.parametrize("idx", [0,1]) +def test_finite_extension_from_limit_valuation_w(w, idx): r""" Run the ``TestSuite()`` for two examples given in the ``FiniteExtensionFromLimitValuation`` documentation. """ from sage.misc.sage_unittest import TestSuite - # Convert the string to a real fixture - e = request.getfixturevalue(e) - # fewer max_runs, these are kind of slow - TestSuite(e).run(verbose=True, - raise_on_failure=True, - max_runs=512) + TestSuite(w[idx]).run(verbose=True, + raise_on_failure=True, + max_runs=512)