Skip to content

Commit d7660b9

Browse files
authored
add support for pytest-xdist v2
1 parent f271aaa commit d7660b9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pytest_reportportal/plugin.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636

3737
def is_master(config):
3838
"""
39-
Validate slaveinput attribute.
39+
Validate workerinput attribute.
4040
4141
True if the code running the given pytest.config object
4242
is running in a xdist master node or not running xdist at all.
4343
"""
44-
return not hasattr(config, 'slaveinput')
44+
return not hasattr(config, 'workerinput')
4545

4646

4747
@pytest.mark.optionalhook
@@ -55,8 +55,8 @@ def pytest_configure_node(node):
5555
if node.config._reportportal_configured is False:
5656
# Stop now if the plugin is not properly configured
5757
return
58-
node.slaveinput['py_test_service'] = pickle.dumps(node.config.
59-
py_test_service)
58+
node.workerinput['py_test_service'] = pickle.dumps(
59+
node.config.py_test_service)
6060

6161

6262
def pytest_sessionstart(session):
@@ -132,7 +132,7 @@ def wait_launch(rp_client):
132132

133133
def pytest_sessionfinish(session):
134134
"""
135-
Finish session if has attr 'slaveinput'.
135+
Finish session if has attr 'workerinput'.
136136
137137
:param session: pytest.Session
138138
:return: None
@@ -193,7 +193,7 @@ def pytest_configure(config):
193193
config.py_test_service = PyTestServiceClass()
194194
else:
195195
config.py_test_service = pickle.loads(config.
196-
slaveinput['py_test_service'])
196+
workerinput['py_test_service'])
197197

198198
# set Pytest_Reporter and configure it
199199
if PYTEST_HAS_LOGGING_PLUGIN:

pytest_reportportal/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def collect_tests(self, session):
220220
hier_param = False
221221
display_suite_file_name = True
222222

223-
if not hasattr(session.config, 'slaveinput'):
223+
if not hasattr(session.config, 'workerinput'):
224224
hier_dirs = session.config.getini('rp_hierarchy_dirs')
225225
hier_module = session.config.getini('rp_hierarchy_module')
226226
hier_class = session.config.getini('rp_hierarchy_class')

0 commit comments

Comments
 (0)