Skip to content

New deprecation warning in some tests due to a new decorator in test.support #101167

Closed

Description

@iritkatriel

DeprecationWarning: It is deprecated to return a value that is not None from a test case (<bound method _id of <test.test_dis.DisTests testMethod=test_binary_specialize>>)

Shows up in test_dis, test_compile and test_embed, for tests that use the new @requires_specialization which was added in #100713.

I don't know why this decorator does this while requires_limited_api doesn't.

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    testsTests in the Lib/test dir
    on Jan 19, 2023
  2. zware commented on Jan 19, 2023

    @zware
    Member

    At

    def requires_specialization(test):
    return unittest.skipUnless(opcode.ENABLE_SPECIALIZATION, "requires specialization")

    line 1082 should end with (test). As is, any test decorated with that decorator is disabled completely; the test is set to the skipUnless decorator, not the decorated test.

  3. iritkatriel commented on Jan 19, 2023

    @iritkatriel
    MemberAuthor

    Ah yes, thanks. Are you making a PR or shall I?

  4. zware commented on Jan 19, 2023

    @zware
    Member

    All yours :)

  5. added a commit that references this issue on Jan 19, 2023
  6. iritkatriel commented on Jan 19, 2023

    @iritkatriel
    MemberAuthor

    It's a good deprecation warning!

  7. added a commit that references this issue on Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions