Beispiel #1
0
 def check_driver(cls):
     if not io.have_libhdfs():
         pytest.skip('No libhdfs available on system')
Beispiel #2
0
# HDFS tests


def hdfs_test_client():
    host = os.environ.get('ARROW_HDFS_TEST_HOST', 'localhost')
    user = os.environ['ARROW_HDFS_TEST_USER']
    try:
        port = int(os.environ.get('ARROW_HDFS_TEST_PORT', 20500))
    except ValueError:
        raise ValueError('Env variable ARROW_HDFS_TEST_PORT was not '
                         'an integer')

    return io.HdfsClient.connect(host, port, user)


libhdfs = pytest.mark.skipif(not io.have_libhdfs(),
                             reason='No libhdfs available on system')


HDFS_TMP_PATH = '/tmp/pyarrow-test-{0}'.format(random.randint(0, 1000))

@pytest.fixture(scope='session')
def hdfs(request):
    fixture = hdfs_test_client()
    def teardown():
        fixture.delete(HDFS_TMP_PATH, recursive=True)
        fixture.close()
    request.addfinalizer(teardown)
    return fixture

Beispiel #3
0
 def check_driver(cls):
     if not io.have_libhdfs():
         pytest.fail('No libhdfs available on system')
Beispiel #4
0
# HDFS tests


def hdfs_test_client():
    host = os.environ.get('ARROW_HDFS_TEST_HOST', 'localhost')
    user = os.environ['ARROW_HDFS_TEST_USER']
    try:
        port = int(os.environ.get('ARROW_HDFS_TEST_PORT', 20500))
    except ValueError:
        raise ValueError('Env variable ARROW_HDFS_TEST_PORT was not '
                         'an integer')

    return io.HdfsClient.connect(host, port, user)


libhdfs = pytest.mark.skipif(not io.have_libhdfs(),
                             reason='No libhdfs available on system')

HDFS_TMP_PATH = '/tmp/pyarrow-test-{0}'.format(random.randint(0, 1000))


@pytest.fixture(scope='session')
def hdfs(request):
    fixture = hdfs_test_client()

    def teardown():
        fixture.delete(HDFS_TMP_PATH, recursive=True)
        fixture.close()

    request.addfinalizer(teardown)
    return fixture