Skip to content

PKG/DEP: Make importable without pytest #16088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pandas/tests/io/parser/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def salaries_table():
@pytest.mark.parametrize(
"compression,extension",
[('gzip', '.gz'), ('bz2', '.bz2'), ('zip', '.zip'),
tm._mark_skipif_no_lzma(('xz', '.xz'))])
pytest.mark.skipif(not tm._check_if_lzma(),
reason='need backports.lzma to run')(('xz', '.xz'))])
@pytest.mark.parametrize('mode', ['explicit', 'infer'])
@pytest.mark.parametrize('engine', ['python', 'c'])
def test_compressed_urls(salaries_table, compression, extension, mode, engine):
Expand Down
16 changes: 8 additions & 8 deletions pandas/util/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from distutils.version import LooseVersion

from numpy.random import randn, rand
import pytest
import numpy as np

import pandas as pd
Expand Down Expand Up @@ -52,7 +51,13 @@

from pandas.util import libtesting
from pandas.io.common import urlopen
slow = pytest.mark.slow
try:
import pytest
slow = pytest.mark.slow
except ImportError:
# Should be ok to just ignore. If you actually need
# slow then you'll hit an import error long before getting here.
pass


N = 30
Expand Down Expand Up @@ -347,15 +352,10 @@ def _check_if_lzma():


def _skip_if_no_lzma():
import pytest
return _check_if_lzma() or pytest.skip('need backports.lzma to run')


_mark_skipif_no_lzma = pytest.mark.skipif(
not _check_if_lzma(),
reason='need backports.lzma to run'
)


def _skip_if_no_xarray():
try:
import xarray
Expand Down