|
2 | 2 |
|
3 | 3 | from __future__ import annotations
|
4 | 4 |
|
| 5 | +import glob |
5 | 6 | import os
|
6 | 7 | import pickle
|
7 | 8 | from typing import TYPE_CHECKING, BinaryIO
|
@@ -85,19 +86,25 @@ def get_full_nodeid(pyfuncitem):
|
85 | 86 | return full_nodeid
|
86 | 87 |
|
87 | 88 |
|
| 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 | + |
88 | 97 | def pytest_configure(config: _pytest.config.Config):
|
89 | 98 | gold_basename = "results-gold"
|
90 | 99 | cudf_basename = "results-cudf-pandas"
|
91 | 100 | test_folder = os.path.join(os.path.dirname(__file__))
|
92 | 101 |
|
93 | 102 | 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") |
96 | 105 | 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) |
101 | 108 | config.stash[results] = (gold_results, cudf_results)
|
102 | 109 | else:
|
103 | 110 | # Strip whitespace from each plugin name before checking
|
|
0 commit comments