Skip to content

Commit 6ee5824

Browse files
authored
chore: add unit test nox session w/o extras (#623)
1 parent 6502a60 commit 6ee5824

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

noxfile.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
3333
nox.options.sessions = [
34+
"unit_noextras",
3435
"unit",
3536
"system",
3637
"snippets",
@@ -42,7 +43,7 @@
4243
]
4344

4445

45-
def default(session):
46+
def default(session, install_extras=True):
4647
"""Default unit test session.
4748
4849
This is intended to be run **without** an interpreter set, so
@@ -65,7 +66,8 @@ def default(session):
6566
constraints_path,
6667
)
6768

68-
session.install("-e", ".[all]", "-c", constraints_path)
69+
install_target = ".[all]" if install_extras else "."
70+
session.install("-e", install_target, "-c", constraints_path)
6971

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

@@ -90,6 +92,12 @@ def unit(session):
9092
default(session)
9193

9294

95+
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS[-1])
96+
def unit_noextras(session):
97+
"""Run the unit test suite."""
98+
default(session, install_extras=False)
99+
100+
93101
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
94102
def system(session):
95103
"""Run the system test suite."""

tests/unit/test__pandas_helpers.py

+1
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,7 @@ def test_download_dataframe_row_iterator_dict_sequence_schema(module_under_test)
14641464
result = next(results_gen)
14651465

14661466

1467+
@pytest.mark.skipif(pandas is None, reason="Requires `pandas`")
14671468
def test_table_data_listpage_to_dataframe_skips_stop_iteration(module_under_test):
14681469
dataframe = module_under_test._row_iterator_page_to_dataframe([], [], {})
14691470
assert isinstance(dataframe, pandas.DataFrame)

tests/unit/test_client.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@
6565
from tests.unit.helpers import make_connection
6666

6767
PANDAS_MINIUM_VERSION = pkg_resources.parse_version("1.0.0")
68-
PANDAS_INSTALLED_VERSION = pkg_resources.get_distribution("pandas").parsed_version
68+
69+
if pandas is not None:
70+
PANDAS_INSTALLED_VERSION = pkg_resources.get_distribution("pandas").parsed_version
71+
else:
72+
# Set to less than MIN version.
73+
PANDAS_INSTALLED_VERSION = pkg_resources.parse_version("0.0.0")
6974

7075

7176
def _make_credentials():

0 commit comments

Comments
 (0)