parametrized pytest - how to run concurrently
See original GitHub issueHey,
I have a parametrize snippet looking like:
scenarios: List[Tuple[str, Dict[str, str]]] = load_scenarios()
for scenario in scenarios:
idlist.append(scenario[0])
items = scenario[1].items()
argnames = [item[0] for item in items]
argvalues.append([item[1] for item in items])
metafunc.parametrize(argnames, argvalues, ids=idlist, scope='class')
This collects 263 total tests. I am going to add a few other tests and the total collected with scenarios will ballon to ~780. Don’t ask. Each indidivual test takes about 1-2.5s. Based on this parametrize collection, pytest-parallel
and xdist
are not gonna work, at least not so far as I’ve tried testing. How might I actually get these concurrent?
Also - each of the 263 tests spawns a Popen
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Parallely running parameterized tests in pytest - Stack Overflow
This is for a concurrency testing scenario. Same testcase runs in parallel with different parameters in a device. After completing all the ......
Read more >Parametrizing tests — pytest documentation
Let's say we want to execute a test with different computation parameters and the parameter range shall be determined by a command line...
Read more >pytest tricks: Parametrize Twice - Calmcode
In pytest, you're able to stack parametrize calls. ... You can test for many values in pytest in a single test by using...
Read more >Part 6 - How to Parametrize test in PyTest (Parameterization)
In this video, I have explained how to paramterize test cases with different data in pytest.Parameterizing of a test is done to run...
Read more >Pytest - Run Tests in Parallel - Tutorialspoint
By default, pytest runs tests in sequential order. In a real scenario, a test suite will have a number of test files and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
yeah, my point was that mutating
pytest.setup_completed
will not be reflected in other processesOk, got it working after removing the nonce. Full snippets for future people that come to this issue: