Skip to content

fix(tests): five rfdetr-seg static-crop tests shadow each other by name - #2948

Merged
PawelPeczek-Roboflow merged 2 commits into
roboflow:mainfrom
Anai-Guo:fix/rfdetr-seg-onnx-duplicate-test-names
Sep 11, 2026
Merged

PawelPeczek-Roboflow merged 2 commits into
roboflow:mainfrom
Anai-Guo:fix/rfdetr-seg-onnx-duplicate-test-names

Conversation

@Anai-Guo

@Anai-Guo Anai-Guo commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

What

inference_models/tests/integration_tests/models/test_rfdetr_seg_predictions_onnx.py has three blocks of static-crop package tests — stretch, letterbox and center-crop — each written by copying the previous one. The center-crop block kept the letterbox names:

line test name fixture it actually uses
938 test_package_with_static_crop_letterbox_against_numpy_input ..._static_crop_letterbox_package
1088 test_package_with_static_crop_letterbox_against_numpy_input ..._static_crop_**center_crop**_package

…and the same for _numpy_list_input, _torch_input, _torch_list_input and _torch_batch_input — five collisions in total.

pytest collects module attributes, so for each of those five names the second definition replaces the first. Net effect:

  • the five letterbox tests have not been collected at all, so the letterbox static-crop package has no coverage;
  • the five center-crop tests were being reported under a letterbox name.

Checkable without running the suite (it needs GPU/ONNX extras):

$ python -c "
import ast, collections
p='inference_models/tests/integration_tests/models/test_rfdetr_seg_predictions_onnx.py'
n=[f.name for f in ast.parse(open(p).read()).body if isinstance(f, ast.FunctionDef)]
print([k for k,v in collections.Counter(n).items() if v>1])"
['test_package_with_static_crop_letterbox_against_numpy_input',
 'test_package_with_static_crop_letterbox_against_numpy_list_input',
 'test_package_with_static_crop_letterbox_against_torch_input',
 'test_package_with_static_crop_letterbox_against_torch_list_input',
 'test_package_with_static_crop_letterbox_against_torch_batch_input',
 'test_package_with_static_crop_stretch_against_numpy_input']

Change

Rename the five center-crop definitions to test_package_with_static_crop_center_crop_*, matching the fixture each one requests. Pure rename — no fixture, marker, body or assertion is touched, and the new names do not collide with the existing (non-static-crop) test_package_with_center_crop_* tests.

These tests are @pytest.mark.slow @pytest.mark.onnx_extras and need a GPU/ONNX environment I do not have, so I could not execute them here. The five letterbox tests are being collected for the first time — if their expected boxes/mask areas need refreshing, I'm happy to update them in this PR.

One thing I left alone

The same script also reports test_package_with_static_crop_stretch_against_numpy_input twice (lines 701 and 905). Those two use the same fixture and the same call but assert different boxes and mask bounds, so only a maintainer can say which one is current — I did not want to guess, and it is a separate concern from the letterbox/center-crop mix-up.


🤖 Generated with Claude Code

…heir fixture

test_rfdetr_seg_predictions_onnx.py has three blocks of static-crop package
tests - stretch, letterbox and center-crop - built by copying the previous
block. The center-crop block kept the letterbox names:

    line 938  test_package_with_static_crop_letterbox_against_numpy_input
              ... snakes_rfdetr_seg_onnx_static_bs_static_crop_letterbox_package
    line 1088 test_package_with_static_crop_letterbox_against_numpy_input
              ... snakes_rfdetr_seg_onnx_static_bs_static_crop_center_crop_package

and likewise for _numpy_list_input, _torch_input, _torch_list_input and
_torch_batch_input. Since pytest collects module attributes, the second
definition of each name replaces the first: all five letterbox tests have
silently not been collected, and the five center-crop tests were reported
under a letterbox name.

Rename the five center-crop definitions to
test_package_with_static_crop_center_crop_* so both blocks are collected. This
is a pure rename - no fixture, marker, body or assertion is touched.

Signed-off-by: Tai An <antai12232931@outlook.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ PawelPeczek-Roboflow
❌ Anai-Guo
You have signed the CLA already but the status is still pending? Let us recheck it.

@PawelPeczek-Roboflow
PawelPeczek-Roboflow merged commit 8bb0c62 into roboflow:main Sep 11, 2026
1 of 2 checks passed
@PawelPeczek-Roboflow

PawelPeczek-Roboflow commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

@Anai-Guo sorry - made mistake merging w/o checking CLA
We require this to be signed, I must have reverted your PR here: #2971
contribution is generally fine - would you open another PR and consider signing CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants