File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 44"""
55
66from functools import partial
7+ import os
78
89import pytest
910
@@ -68,7 +69,9 @@ def __init__(self, config):
6869 self .skip = config .getoption ('benchmark_skip' )
6970 self .disabled = config .getoption ('benchmark_disable' ) and not config .getoption ('benchmark_enable' )
7071
71- if config .getoption ('dist' , 'no' ) != 'no' and not self .skip and not self .disabled :
72+ # Only the main process has the 'dist' field in the config.
73+ xdist_active = config .getoption ('dist' , 'no' ) != 'no' or os .environ .get ('PYTEST_XDIST_WORKER' , None )
74+ if xdist_active and not self .skip and not self .disabled :
7275 self .logger .warning (
7376 'Benchmarks are automatically disabled because xdist plugin is active.'
7477 'Benchmarks cannot be performed reliably in a parallelized environment.' ,
You can’t perform that action at this time.
0 commit comments