Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion python/pyarrow/tests/test_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,22 @@ def deserialize_regex(serialized, q):
p.join()


def _get_modified_env_with_pythonpath():
# Prepend pyarrow root directory to PYTHONPATH
env = os.environ.copy()
existing_pythonpath = env.get('PYTHONPATH', '')
if sys.platform == 'win32':
sep = ';'
else:
sep = ':'

module_path = os.path.abspath(
os.path.dirname(os.path.dirname(pa.__file__)))

env['PYTHONPATH'] = sep.join((module_path, existing_pythonpath))
return env


def test_deserialize_buffer_in_different_process():
import tempfile
import subprocess
Expand All @@ -589,9 +605,12 @@ def test_deserialize_buffer_in_different_process():
f.write(b.to_pybytes())
f.close()

subprocess_env = _get_modified_env_with_pythonpath()

dir_path = os.path.dirname(os.path.realpath(__file__))
python_file = os.path.join(dir_path, 'deserialize_buffer.py')
subprocess.check_call([sys.executable, python_file, f.name])
subprocess.check_call([sys.executable, python_file, f.name],
env=subprocess_env)


def test_set_pickle():
Expand Down