()
| 58 | |
| 59 | @pytest.mark.processes |
| 60 | def 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 | |
| 86 | def test_build_info(): |
nothing calls this directly
no test coverage detected