MCPcopy Create free account
hub / github.com/apache/arrow / test_env_var_io_thread_count

Function test_env_var_io_thread_count

python/pyarrow/tests/test_misc.py:60–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58
59@pytest.mark.processes
60def test_env_var_io_thread_count():
61 # Test that the number of IO threads can be overridden with the
62 # ARROW_IO_THREADS environment variable.
63 code = """if 1:
64 import pyarrow as pa
65 print(pa.io_thread_count())
66 """
67
68 def run_with_env_var(env_var):
69 env = os.environ.copy()
70 env['ARROW_IO_THREADS'] = env_var
71 res = subprocess.run([sys.executable, "-c", code], env=env,
72 capture_output=True)
73 res.check_returncode()
74 return res.stdout.decode(), res.stderr.decode()
75
76 out, err = run_with_env_var('17')
77 assert out.strip() == '17'
78 assert err == ''
79
80 for v in ('-1', 'z'):
81 out, err = run_with_env_var(v)
82 assert out.strip() == '8' # default value
83 assert "Invalid value for ARROW_IO_THREADS" in err.strip()
84
85
86def test_build_info():

Callers

nothing calls this directly

Calls 1

run_with_env_varFunction · 0.85

Tested by

no test coverage detected