Skip to content

Commit 5651c00

Browse files
committed
add support for xdist
1 parent 009edac commit 5651c00

File tree

1 file changed

+13
-6
lines changed
  • python/cudf/cudf_pandas_tests/third_party_integration_tests/tests

1 file changed

+13
-6
lines changed

python/cudf/cudf_pandas_tests/third_party_integration_tests/tests/conftest.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import glob
56
import os
67
import pickle
78
from typing import TYPE_CHECKING, BinaryIO
@@ -85,19 +86,25 @@ def get_full_nodeid(pyfuncitem):
8586
return full_nodeid
8687

8788

89+
def read_all_results(pattern):
90+
results = {}
91+
for filepath in glob.glob(pattern):
92+
with open(filepath, "rb") as f:
93+
results.update(dict(read_results(f)))
94+
return results
95+
96+
8897
def pytest_configure(config: _pytest.config.Config):
8998
gold_basename = "results-gold"
9099
cudf_basename = "results-cudf-pandas"
91100
test_folder = os.path.join(os.path.dirname(__file__))
92101

93102
if config.getoption("--compare"):
94-
gold_path = os.path.join(test_folder, f"{gold_basename}.pickle")
95-
cudf_path = os.path.join(test_folder, f"{cudf_basename}.pickle")
103+
gold_path = os.path.join(test_folder, f"{gold_basename}*.pickle")
104+
cudf_path = os.path.join(test_folder, f"{cudf_basename}*.pickle")
96105
with disable_module_accelerator():
97-
with open(gold_path, "rb") as f:
98-
gold_results = dict(read_results(f))
99-
with open(cudf_path, "rb") as f:
100-
cudf_results = dict(read_results(f))
106+
gold_results = read_all_results(gold_path)
107+
cudf_results = read_all_results(cudf_path)
101108
config.stash[results] = (gold_results, cudf_results)
102109
else:
103110
# Strip whitespace from each plugin name before checking

0 commit comments

Comments
 (0)