kevlened / pytest-parallel

A pytest plugin for parallel and concurrent testing
https://github.com/browsertron/pytest-parallel/issues/104#issuecomment-1293941066
MIT License
313 stars 60 forks source link

fixture will be repeated with the case use pytest.mark.parametrize #32

Open Guanyan1996 opened 5 years ago

Guanyan1996 commented 5 years ago

`import pytest

@pytest.fixture(scope='module') def a(): a = 'nihao' print('初始化') return a

@pytest.mark.parametrize('data',['a','b','c']) def test_001(a,data): print(a,data)`

this code ,the fixture will be used three times when I use the pytest-parallel

if i don't use pytest-parallel,only once.

psdon commented 5 years ago

This is not a bug. Kindly proceed to pytest documentation -> https://pytest.readthedocs.io/en/2.8.7/parametrize.html

pksol commented 4 years ago

This is not a bug. Kindly proceed to pytest documentation -> https://pytest.readthedocs.io/en/2.8.7/parametrize.html

I went over the link and did not see how does it answer the question. Can you be more specific as to why the fixture scope is not honored when using pytest-parallel?