|
40 | 40 |
|
41 | 41 | from . import _pickle_multiprocessing_helpers as helpers |
42 | 42 |
|
43 | | -# `pytest --import-mode=importlib` (used in CI) does not prepend the test |
44 | | -# parent directory to `sys.path`; pytest loads `tests` via its own importlib |
45 | | -# hook. multiprocessing forkserver / spawn workers receive only the parent's |
| 43 | +# `pytest --import-mode=importlib` (used in CI) does not put the test parent |
| 44 | +# directory on `sys.path`; pytest loads `tests` via its own importlib hook. |
| 45 | +# multiprocessing forkserver / spawn workers receive only the parent's |
46 | 46 | # `sys.path` snapshot, not pytest's hook, so they fail to import |
47 | 47 | # `tests._pickle_multiprocessing_helpers` with `ModuleNotFoundError: No module |
48 | | -# named 'tests'`. Ensure the parent directory of the `tests` package is on |
49 | | -# `sys.path` so workers can resolve it the standard way. Fork start method is |
50 | | -# unaffected (inherits the already-imported module object). |
| 48 | +# named 'tests'`. Append (not prepend) the parent directory of the `tests` |
| 49 | +# package so workers can resolve it the standard way, *without* shadowing the |
| 50 | +# installed `datafusion` wheel — the source tree's `python/datafusion/` has |
| 51 | +# no `_internal` extension module (that lives in the wheel under |
| 52 | +# site-packages), so prepending would break `from datafusion._internal |
| 53 | +# import ...`. Fork start method is unaffected (inherits the already-imported |
| 54 | +# module object). |
51 | 55 | _TESTS_PARENT = str(Path(__file__).resolve().parent.parent) |
52 | 56 | if _TESTS_PARENT not in sys.path: |
53 | | - sys.path.insert(0, _TESTS_PARENT) |
| 57 | + sys.path.append(_TESTS_PARENT) |
54 | 58 |
|
55 | 59 |
|
56 | 60 | @contextlib.contextmanager |
|
0 commit comments