Questions tagged [xdist]

PyTest xdist is a plugin that allows parallel and distributed execution of unittests.

PyTest xdist is a plugin that allows parallel and distributed execution of unittests.

http://pytest.org/latest/xdist.html

74 questions
0
votes
1 answer

How to execute pytest paralelly through xdist plugin?

How can I run my pytests parallely on multiple custom environments ? I have pytest-xdist as well. Not sure if this plugin helps test_test.py @pytest.mark.env("env1", "env2", "env3") def test_check(env): print("Chosen {} for test_check…
Bharath Kashyap
  • 343
  • 2
  • 5
  • 14
0
votes
0 answers

patch doesn't work with pytest when not specifying a directory

I have a weird problem with pytest and mock patching. My django app calls currency exchanges' APIs when receiving a request. I want to patch them while testing, but it doesn't work. The command below succeeds. It doesn't send any request to real…
Shunx
  • 11
  • 1
0
votes
1 answer

Pytest-xdist works with pip but not with pipenv. No tests are loaded/scheduled

Pytest works when I have it installed through pip and pipenv. However, when using the pytest-xdist plugin with the command e.g pytest -n 4, this only works with pip and not pipenv. No tests are scheduled or…
0
votes
2 answers

How can I adjust the number of threads with pytest + xdist?

To run parallel tests on mobile devices, I use pytest + xdist. I want to run as many threads as I have connected devices, no more. I pass "-n 4" as command line argument, but I can't change it after test launch if I need 2 threads, not 4. How can I…
lunin
  • 51
  • 6
0
votes
1 answer

pytest-xdist generate random & uniqe ports for each test

I'm using pytest-xdist plugin to run some test using the @pytest.mark.parametrize to run the same test with different parameters. As part of these tests, I need to open/close web servers and the ports are generated at collection time. xdist does the…
Amir Rossert
  • 1,003
  • 2
  • 13
  • 33
0
votes
1 answer

Python3 xdist with addoption

I want to use the custom options with distributed and subprocess testing. I have 2 addoption --resources_dir and --output_dir. Try to start it with : python3 -m pytest -vs --junitxml=/tmp/result_alert_test.xml --resources_dir=test/resources…
0
votes
1 answer

Concurrent pytest and namespace

I have multiple tests which I run in a concurrent mode (-n) with xdist plugin. Every test creates a personal helper object from a Helper class with specific settings. But finally attributes from different tests are mixed in objects. One test has…
SayPy
  • 536
  • 1
  • 4
  • 13
0
votes
0 answers

PyTest: One test to contact more then one device

looking around a bit and I can't seem to find this answer. I am new to pytest so I could be wording what I am trying to do incorrectly or searching with wrong parameters but here I go. I made a test that SSH's to a router and checks that it logged…
Keith
  • 11
  • 2
0
votes
1 answer

record_xml_property does not work with xdist

I am actively using record_xml_property fixture in my tests, but unfortunately it just does not work with xdsit plugin. I've tried to implement a workaround. Instead of directly add properties to the reporter, I put them to the…
Ilya
  • 11
  • 2
0
votes
2 answers

how to remove *.pyc files created by pytest

I just started using pytest with pytest-xdist, to execute tests on remote hosts. the remote host (windows) are using the socketserver.py module found on https://pytest.org/latest/xdist.html my problem is that it seems like each time I execute a…
0
votes
0 answers

pytest scope function not creating 2 instances of browser

I am trying to run 2 tests in parallel using xdist so before that I tried to make each test independent. This is where I'm setting up browser. @pytest.fixture(scope="function") def moduleSetup(request): driver = webdriver.Firefox() def…
user2661518
  • 2,677
  • 9
  • 42
  • 79
0
votes
2 answers

Can pytest xdist tests log to the same configuration?

I'm using pytest with the xdist plugin to run a large suite of tests. These tests can take a few hours to run, so I'd like to see certain information while they are running. The items I'd like to see are the errors when tests fail, how many tests…
user197674
  • 748
  • 2
  • 7
  • 22
0
votes
0 answers

pytest xdist and setup hook execution

I am having trouble getting my plugin pytest_runtest_setup hook executing with xdist plugin. It executes without specifying -n option, but as soon as I specify that option the hook doesn't execute. My pytest_runtest_makereport always works. Any…
Aaron
  • 3,249
  • 4
  • 35
  • 51
0
votes
1 answer

Trying to understand pytest-xdist failures for parametrized tests

I have some parametrized tests that use a fixture defined in conftest. My tests are failing when pytest-xdist is used but pass with standard pytest. The fixture creates a directory which is then used by the test and I'm getting IOErrors. From the…
jasmine
  • 115
  • 1
  • 1
  • 6
1 2 3 4
5