Skip to content

Conversation

@ev-br
Copy link
Member

@ev-br ev-br commented Feb 7, 2026

fixes gh-415

Is on top of gh-414:

  • ENH: expand_dims tuple axes #414 adds a second test for expand_dims
  • d597b5c groups the two tests into a test class; this fails because @pytest.mark.unvectorized only works for standalone functions
  • the rest is a fix for our @pytest.mark.unvectorized, drafted by Copilot

So the test update is localized to test_manipulation_functions.py, and the fix to gh-415 is only in conftest.py.
Now that fix is horrifying. Do we really need to do setattr(item.cls, ...), or, as initial Copilot's attempt was, item.obj.__self__.__class__.

EDIT: asked upstream, https://groups.google.com/g/hypothesis-users/c/6K6WPR5knAs --- and there's a recommended alternative, which is now used here.
So thanks to Copilot for helping me start this, but in the end the score is Copilot 0, Liam DeVoe 1.

EDIT2 : draft status until gh-414 is in, to separate concerns.

ev-br and others added 9 commits February 5, 2026 20:18
cf data-apis#760 for discussion
We test here that expand_dims with multiple axes is equivalent to
expanding axes one by one---the key is that the axes to add need
to be pre-sorted.
Co-authored-by: ev-br <2133832+ev-br@users.noreply.github.com>
Co-authored-by: ev-br <2133832+ev-br@users.noreply.github.com>
Co-authored-by: ev-br <2133832+ev-br@users.noreply.github.com>
@ev-br ev-br force-pushed the copilot-fix-unvectorized-tests-for-classes branch from 30bafa5 to c0e148c Compare February 7, 2026 18:32
@ev-br ev-br marked this pull request as draft February 8, 2026 13:10
@ev-br
Copy link
Member Author

ev-br commented Feb 9, 2026

The fix to @unvectorized decorator is fixed in gh-422, the rest is gh-414. Closing this one.

@ev-br ev-br closed this Feb 9, 2026
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.

@pytest.mark.unvectorized breaks when a test function is a part of a TestClass

2 participants