Skip to content

Commit

Permalink
TST: Add test for the large file read/write
Browse files Browse the repository at this point in the history
  • Loading branch information
Licht-T committed Nov 1, 2017
1 parent db7ef3a commit 3b5782a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
14 changes: 13 additions & 1 deletion python/pyarrow/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

from pytest import skip
from pytest import skip, mark


groups = [
Expand Down Expand Up @@ -70,6 +70,18 @@ def pytest_addoption(parser):
default=False,
help=('Run only the {0} test group'.format(group)))

parser.addoption('--runslow', action='store_true',
default=False, help='run slow tests')


def pytest_collection_modifyitems(config, items):
if not config.getoption('--runslow'):
skip_slow = mark.skip(reason='need --runslow option to run')

for item in items:
if 'slow' in item.keywords:
item.add_marker(skip_slow)


def pytest_runtest_setup(item):
only_set = False
Expand Down
10 changes: 8 additions & 2 deletions python/pyarrow/tests/test_feather.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def tearDown(self):
pass

def test_file_not_exist(self):
with self.assertRaises(pa.ArrowIOError):
with pytest.raises(pa.ArrowIOError):
FeatherReader('test_invalid_file')

def _get_null_counts(self, path, columns=None):
Expand Down Expand Up @@ -98,7 +98,7 @@ def _assert_error_on_write(self, df, exc, path=None):
def f():
write_feather(df, path)

self.assertRaises(exc, f)
pytest.raises(exc, f)

def test_num_rows_attr(self):
df = pd.DataFrame({'foo': [1, 2, 3, 4, 5]})
Expand Down Expand Up @@ -466,3 +466,9 @@ def test_unsupported(self):
# non-strings
df = pd.DataFrame({'a': ['a', 1, 2.0]})
self._assert_error_on_write(df, ValueError)

@pytest.mark.slow
def test_large_dataframe(self):
df = pd.DataFrame(np.random.randint(0, 100, size=(400000000, 1)),
columns=list('A'))
self._check_pandas_roundtrip(df)

0 comments on commit 3b5782a

Please sign in to comment.