Skip to content

Commit c382a44

Browse files
authored
chore: skip small udf tests from system and coverage tests (#1493)
* chore: skip the small udf tests from system and coverage tests * store pytest.mark.skipif in a variable * name `pytestmark` to trigger module level pytest.mark.skipif
1 parent 50fa2fb commit c382a44

File tree

2 files changed

+10
-32
lines changed

2 files changed

+10
-32
lines changed

noxfile.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,10 @@ def cover(session):
469469
"--show-missing",
470470
"--include=tests/unit/*",
471471
"--include=tests/system/small/*",
472+
# TODO(b/401609005): remove this omission once either the small udf
473+
# tests are made to run in system tests or they are moved to large
474+
# system tests (aka e2e tests)
475+
"--omit=tests/system/small/functions/test_managed_function.py",
472476
# TODO(b/353775058) resume coverage to 100 when the issue is fixed.
473477
"--fail-under=99",
474478
)

tests/system/small/functions/test_managed_function.py

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424
import bigframes.series
2525
from tests.system.utils import assert_pandas_df_equal, get_function_name
2626

27-
bpd.options.experiments.udf = True
28-
29-
30-
@pytest.mark.skipif(
27+
pytestmark = pytest.mark.skipif(
3128
get_python_version() not in bff_session._MANAGED_FUNC_PYTHON_VERSIONS,
3229
reason=f"Supported version: {bff_session._MANAGED_FUNC_PYTHON_VERSIONS}",
3330
)
31+
32+
33+
bpd.options.experiments.udf = True
34+
35+
3436
@pytest.mark.parametrize(
3537
("typ",),
3638
[
@@ -79,10 +81,6 @@ def foo(x):
7981
assert_pandas_df_equal(bf_result, pd_result, check_dtype=False)
8082

8183

82-
@pytest.mark.skipif(
83-
get_python_version() not in bff_session._MANAGED_FUNC_PYTHON_VERSIONS,
84-
reason=f"Supported version: {bff_session._MANAGED_FUNC_PYTHON_VERSIONS}",
85-
)
8684
def test_managed_function_series_combine(dataset_id_permanent, scalars_dfs):
8785
# This function is deliberately written to not work with NA input.
8886
def add(x: int, y: int) -> int:
@@ -127,10 +125,6 @@ def add(x: int, y: int) -> int:
127125
pd.testing.assert_series_equal(pd_result, bf_result, check_dtype=False)
128126

129127

130-
@pytest.mark.skipif(
131-
get_python_version() not in bff_session._MANAGED_FUNC_PYTHON_VERSIONS,
132-
reason=f"Supported version: {bff_session._MANAGED_FUNC_PYTHON_VERSIONS}",
133-
)
134128
@pytest.mark.parametrize(
135129
("typ",),
136130
[
@@ -170,10 +164,6 @@ def foo_list(x):
170164
assert_pandas_df_equal(bf_result, pd_result, check_dtype=False)
171165

172166

173-
@pytest.mark.skipif(
174-
get_python_version() not in bff_session._MANAGED_FUNC_PYTHON_VERSIONS,
175-
reason=f"Supported version: {bff_session._MANAGED_FUNC_PYTHON_VERSIONS}",
176-
)
177167
def test_managed_function_series_combine_list_output(dataset_id_permanent, scalars_dfs):
178168
def add_list(x: int, y: int) -> list[int]:
179169
return [x, y]
@@ -209,10 +199,6 @@ def add_list(x: int, y: int) -> list[int]:
209199
pd.testing.assert_series_equal(pd_result, bf_result, check_dtype=False)
210200

211201

212-
@pytest.mark.skipif(
213-
get_python_version() not in bff_session._MANAGED_FUNC_PYTHON_VERSIONS,
214-
reason=f"Supported version: {bff_session._MANAGED_FUNC_PYTHON_VERSIONS}",
215-
)
216202
def test_managed_function_dataframe_map(scalars_dfs, dataset_id_permanent):
217203
def add_one(x):
218204
return x + 1
@@ -244,10 +230,6 @@ def add_one(x):
244230
assert_pandas_df_equal(bf_result, pd_result)
245231

246232

247-
@pytest.mark.skipif(
248-
get_python_version() not in bff_session._MANAGED_FUNC_PYTHON_VERSIONS,
249-
reason=f"Supported version: {bff_session._MANAGED_FUNC_PYTHON_VERSIONS}",
250-
)
251233
def test_managed_function_dataframe_apply_axis_1(
252234
session, scalars_dfs, dataset_id_permanent
253235
):
@@ -284,10 +266,6 @@ def add_ints(x, y):
284266
)
285267

286268

287-
@pytest.mark.skipif(
288-
get_python_version() not in bff_session._MANAGED_FUNC_PYTHON_VERSIONS,
289-
reason=f"Supported version: {bff_session._MANAGED_FUNC_PYTHON_VERSIONS}",
290-
)
291269
def test_managed_function_dataframe_map_list_output(scalars_dfs, dataset_id_permanent):
292270
def add_one_list(x):
293271
return [x + 1] * 3
@@ -314,10 +292,6 @@ def add_one_list(x):
314292
assert_pandas_df_equal(bf_result, pd_result, check_dtype=False)
315293

316294

317-
@pytest.mark.skipif(
318-
get_python_version() not in bff_session._MANAGED_FUNC_PYTHON_VERSIONS,
319-
reason=f"Supported version: {bff_session._MANAGED_FUNC_PYTHON_VERSIONS}",
320-
)
321295
def test_managed_function_dataframe_apply_axis_1_list_output(
322296
session, scalars_dfs, dataset_id_permanent
323297
):

0 commit comments

Comments
 (0)