From cb5bbc40fe72827f4c895071ed469a93a0e85aa7 Mon Sep 17 00:00:00 2001 From: Molly Xu Date: Wed, 7 Jan 2026 13:48:49 -0800 Subject: [PATCH 1/3] address edge case --- test/conftest.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/conftest.py b/test/conftest.py index fa674bf60..f7af1b4f0 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -35,12 +35,20 @@ def pytest_collection_modifyitems(items): needs_cuda = item.get_closest_marker("needs_cuda") is not None needs_ffmpeg_cli = item.get_closest_marker("needs_ffmpeg_cli") is not None has_skip_marker = item.get_closest_marker("skip") is not None - has_skipif_marker = item.get_closest_marker("skipif") is not None + + # For skipif, the marker is always present regardless of whether the + # condition is True or False, so we must check the actual condition. + skipif_condition_is_true = False + for skipif_marker in item.iter_markers("skipif"): + condition = skipif_marker.args[0] + if condition: + skipif_condition_is_true = True + break if in_fbcode(): # fbcode doesn't like skipping tests, so instead we just don't collect the test # so that they don't even "exist", hence the continue statements. - if needs_ffmpeg_cli or has_skip_marker or has_skipif_marker: + if needs_ffmpeg_cli or has_skip_marker or skipif_condition_is_true: continue if ( From 32bede494cab31b395e10f46a026694e31c04db6 Mon Sep 17 00:00:00 2001 From: Molly Xu <64995721+mollyxu@users.noreply.github.com> Date: Thu, 8 Jan 2026 10:11:53 -0500 Subject: [PATCH 2/3] Address comment Co-authored-by: Nicolas Hug --- test/conftest.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/conftest.py b/test/conftest.py index f7af1b4f0..260bde0f4 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -38,12 +38,8 @@ def pytest_collection_modifyitems(items): # For skipif, the marker is always present regardless of whether the # condition is True or False, so we must check the actual condition. - skipif_condition_is_true = False - for skipif_marker in item.iter_markers("skipif"): - condition = skipif_marker.args[0] - if condition: - skipif_condition_is_true = True - break + skipif_condition_is_true = any(skipif_marker.args[0] for skipif_marker in item.iter_markers("skipif")) + if in_fbcode(): # fbcode doesn't like skipping tests, so instead we just don't collect the test From 2ad5d7d8064f38f091d40b07a43814fcb7853930 Mon Sep 17 00:00:00 2001 From: Molly Xu Date: Thu, 8 Jan 2026 07:18:37 -0800 Subject: [PATCH 3/3] fix lint --- test/conftest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/conftest.py b/test/conftest.py index 260bde0f4..8e61d8a94 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -38,8 +38,9 @@ def pytest_collection_modifyitems(items): # For skipif, the marker is always present regardless of whether the # condition is True or False, so we must check the actual condition. - skipif_condition_is_true = any(skipif_marker.args[0] for skipif_marker in item.iter_markers("skipif")) - + skipif_condition_is_true = any( + skipif_marker.args[0] for skipif_marker in item.iter_markers("skipif") + ) if in_fbcode(): # fbcode doesn't like skipping tests, so instead we just don't collect the test