Questions tagged [pytest-parallel]

7 questions
5
votes
1 answer

How to run setup (fixture) once and then tests in parallel

I was using pytest-xdist to run tests in parallel, but my suite setup is very huge and bulky, which I want to avoid running multiple times in each tests execution. While I was using pytest-xdist to run all the tests in parallel, I came across the…
3
votes
1 answer

pytest-parallel not honouring module-scope fixtures

Suppose I have the below test cases written in a file, test_something.py: @pytest.fixture(scope="module") def get_some_binary_file(): # Some logic here that creates a path "/a/b/bin" and then downloads a binary into this path …
user1452759
  • 8,810
  • 15
  • 42
  • 58
2
votes
0 answers

Runtime statistics for parallel test function calls (with pytest-benchmark or some other plugin)

I want to use a plugin like pytest-benchmark to show me runtime statistics for the parallel calls test_valid_submission(0), ..., test_valid_submission(EXPERIMENT_SIZE). For this, I have the following code, which tries to achieve this using…
DaveFar
  • 7,078
  • 4
  • 50
  • 90
1
vote
1 answer

Pytest-parallel executing test case twice

For parallel execution i am using pytest-parallel, it works but each test cases is executing twice def test_2(): assert 2==2 def test_3(): assert 1 == 1 command used pytest -v -s test_file.py --workers auto What auto will do like trigger…
user3814582
  • 153
  • 2
  • 15
0
votes
0 answers

Pytest-parallel lib. How to get worker id like in pytest-xdist?

Now when using pytest-parallel lib the worker_id could not be found by this plugin since (a guess) this is only xdist compatible fixture to get worker id. `@pytest.fixture(scope='session') def driver_path_lock(selenium_config: SeleniumConfig,…
0
votes
0 answers

how to run pytest.main() with thread

def run_tasks(): tasks = get_tasks(task_id) #task_list for task in tasks: t = threading.Thread(target=exec_task, args=(task,), name=task['id']) t.start() def exec_task(task): pytest.main('-s', '-v', task['path']) I…
0
votes
1 answer

Py.Test Can't find pytest-parallel when invoked programmatically

I am trying to send parallel arguments by a programmatic invocation to pytest but doesn't seem to recognize them like when parallel is not installed at all, except that I know is there because when I run py.test with a direct command line invocation…
gerosalesc
  • 2,983
  • 3
  • 27
  • 46