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

Function test_timezone_database_absent

python/pyarrow/tests/test_orc.py:148–165  ·  view source on GitHub ↗
(datadir)

Source from the content-addressed store, hash-verified

146
147
148def test_timezone_database_absent(datadir):
149 # Example file relies on the timezone "US/Pacific". It should gracefully
150 # fail, not crash, if the timezone database is not found.
151 path = datadir / 'TestOrcFile.testDate1900.orc'
152 code = f"""if 1:
153 import os
154 os.environ['TZDIR'] = '/tmp/non_existent'
155
156 from pyarrow import orc
157 try:
158 orc_file = orc.ORCFile({str(path)!r})
159 orc_file.read()
160 except Exception as e:
161 assert "time zone database" in str(e).lower(), e
162 else:
163 assert False, "Should have raised exception"
164 """
165 subprocess.run([sys.executable, "-c", code], check=True)
166
167
168def test_timezone_absent(datadir, tmpdir):

Callers

nothing calls this directly

Calls 1

runMethod · 0.45

Tested by

no test coverage detected