Skip to content

Commit f2b6040

Browse files
authored
Merge pull request #11238 from bluetech/doc-not-indirect
doc/example/parametrize: a few fixes/improvements
2 parents e324783 + 497a1d7 commit f2b6040

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

doc/en/example/multipython.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
"""
2-
module containing a parametrized tests testing cross-python
3-
serialization via the pickle module.
4-
"""
1+
"""Module containing a parametrized tests testing cross-python serialization
2+
via the pickle module."""
53
import shutil
64
import subprocess
75
import textwrap
86

97
import pytest
108

11-
pythonlist = ["python3.5", "python3.6", "python3.7"]
9+
10+
pythonlist = ["python3.9", "python3.10", "python3.11"]
1211

1312

1413
@pytest.fixture(params=pythonlist)
@@ -43,7 +42,7 @@ def dumps(self, obj):
4342
)
4443
)
4544
)
46-
subprocess.check_call((self.pythonpath, str(dumpfile)))
45+
subprocess.run((self.pythonpath, str(dumpfile)), check=True)
4746

4847
def load_and_is_true(self, expression):
4948
loadfile = self.picklefile.with_name("load.py")
@@ -63,7 +62,7 @@ def load_and_is_true(self, expression):
6362
)
6463
)
6564
print(loadfile)
66-
subprocess.check_call((self.pythonpath, str(loadfile)))
65+
subprocess.run((self.pythonpath, str(loadfile)), check=True)
6766

6867

6968
@pytest.mark.parametrize("obj", [42, {}, {1: 3}])

doc/en/example/parametrize.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,8 @@ argument sets to use for each test function. Let's run it:
483483
FAILED test_parametrize.py::TestClass::test_equals[1-2] - assert 1 == 2
484484
1 failed, 2 passed in 0.12s
485485
486-
Indirect parametrization with multiple fixtures
487-
--------------------------------------------------------------
486+
Parametrization with multiple fixtures
487+
--------------------------------------
488488

489489
Here is a stripped down real-life example of using parametrized
490490
testing for testing serialization of objects between different python
@@ -509,8 +509,8 @@ Running it results in some skips if we don't have all the python interpreters in
509509
SKIPPED [9] multipython.py:69: 'python3.7' not found
510510
27 skipped in 0.12s
511511
512-
Indirect parametrization of optional implementations/imports
513-
--------------------------------------------------------------------
512+
Parametrization of optional implementations/imports
513+
---------------------------------------------------
514514

515515
If you want to compare the outcomes of several implementations of a given
516516
API, you can write test functions that receive the already imported implementations

0 commit comments

Comments
 (0)