Skip to content

Commit

Permalink
chore: add unit test nox session w/o extras (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
plamut committed Apr 23, 2021
1 parent 6502a60 commit 6ee5824
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
12 changes: 10 additions & 2 deletions noxfile.py
Expand Up @@ -31,6 +31,7 @@

# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
nox.options.sessions = [
"unit_noextras",
"unit",
"system",
"snippets",
Expand All @@ -42,7 +43,7 @@
]


def default(session):
def default(session, install_extras=True):
"""Default unit test session.
This is intended to be run **without** an interpreter set, so
Expand All @@ -65,7 +66,8 @@ def default(session):
constraints_path,
)

session.install("-e", ".[all]", "-c", constraints_path)
install_target = ".[all]" if install_extras else "."
session.install("-e", install_target, "-c", constraints_path)

session.install("ipython", "-c", constraints_path)

Expand All @@ -90,6 +92,12 @@ def unit(session):
default(session)


@nox.session(python=UNIT_TEST_PYTHON_VERSIONS[-1])
def unit_noextras(session):
"""Run the unit test suite."""
default(session, install_extras=False)


@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
def system(session):
"""Run the system test suite."""
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test__pandas_helpers.py
Expand Up @@ -1464,6 +1464,7 @@ def test_download_dataframe_row_iterator_dict_sequence_schema(module_under_test)
result = next(results_gen)


@pytest.mark.skipif(pandas is None, reason="Requires `pandas`")
def test_table_data_listpage_to_dataframe_skips_stop_iteration(module_under_test):
dataframe = module_under_test._row_iterator_page_to_dataframe([], [], {})
assert isinstance(dataframe, pandas.DataFrame)
7 changes: 6 additions & 1 deletion tests/unit/test_client.py
Expand Up @@ -65,7 +65,12 @@
from tests.unit.helpers import make_connection

PANDAS_MINIUM_VERSION = pkg_resources.parse_version("1.0.0")
PANDAS_INSTALLED_VERSION = pkg_resources.get_distribution("pandas").parsed_version

if pandas is not None:
PANDAS_INSTALLED_VERSION = pkg_resources.get_distribution("pandas").parsed_version
else:
# Set to less than MIN version.
PANDAS_INSTALLED_VERSION = pkg_resources.parse_version("0.0.0")


def _make_credentials():
Expand Down

0 comments on commit 6ee5824

Please sign in to comment.