File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change 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."""
5
3
import shutil
6
4
import subprocess
7
5
import textwrap
8
6
9
7
import pytest
10
8
11
- pythonlist = ["python3.5" , "python3.6" , "python3.7" ]
9
+
10
+ pythonlist = ["python3.9" , "python3.10" , "python3.11" ]
12
11
13
12
14
13
@pytest .fixture (params = pythonlist )
@@ -43,7 +42,7 @@ def dumps(self, obj):
43
42
)
44
43
)
45
44
)
46
- subprocess .check_call ((self .pythonpath , str (dumpfile )))
45
+ subprocess .run ((self .pythonpath , str (dumpfile )), check = True )
47
46
48
47
def load_and_is_true (self , expression ):
49
48
loadfile = self .picklefile .with_name ("load.py" )
@@ -63,7 +62,7 @@ def load_and_is_true(self, expression):
63
62
)
64
63
)
65
64
print (loadfile )
66
- subprocess .check_call ((self .pythonpath , str (loadfile )))
65
+ subprocess .run ((self .pythonpath , str (loadfile )), check = True )
67
66
68
67
69
68
@pytest .mark .parametrize ("obj" , [42 , {}, {1 : 3 }])
Original file line number Diff line number Diff line change @@ -483,8 +483,8 @@ argument sets to use for each test function. Let's run it:
483
483
FAILED test_parametrize.py::TestClass::test_equals[1-2] - assert 1 == 2
484
484
1 failed, 2 passed in 0.12s
485
485
486
- Indirect parametrization with multiple fixtures
487
- --------------------------------------------------------------
486
+ Parametrization with multiple fixtures
487
+ --------------------------------------
488
488
489
489
Here is a stripped down real-life example of using parametrized
490
490
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
509
509
SKIPPED [9] multipython.py:69: 'python3.7' not found
510
510
27 skipped in 0.12s
511
511
512
- Indirect parametrization of optional implementations/imports
513
- --------------------------------------------------------------------
512
+ Parametrization of optional implementations/imports
513
+ ---------------------------------------------------
514
514
515
515
If you want to compare the outcomes of several implementations of a given
516
516
API, you can write test functions that receive the already imported implementations
You can’t perform that action at this time.
0 commit comments