Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[easy] test_signal: test_pidfd_send_signal() uses deprecated assertRaisesRegexp() method #83605

Closed
vstinner opened this issue Jan 22, 2020 · 4 comments
Labels
3.9 only security fixes easy tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

BPO 39424
Nosy @vstinner, @serhiy-storchaka, @hakancelik96
PRs
  • bpo-39424: Fix the call method. #18277
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-01-30.10:27:59.879>
    created_at = <Date 2020-01-22.16:56:21.303>
    labels = ['easy', 'tests', '3.9']
    title = '[easy] test_signal: test_pidfd_send_signal() uses deprecated assertRaisesRegexp() method'
    updated_at = <Date 2020-01-30.11:59:24.444>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2020-01-30.11:59:24.444>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-01-30.10:27:59.879>
    closer = 'serhiy.storchaka'
    components = ['Tests']
    creation = <Date 2020-01-22.16:56:21.303>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39424
    keywords = ['patch', 'newcomer friendly']
    message_count = 4.0
    messages = ['360486', '360787', '361032', '361047']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'serhiy.storchaka', 'hakancelik']
    pr_nums = ['18277']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue39424'
    versions = ['Python 3.9']

    @vstinner
    Copy link
    Member Author

    test_signal.test_pidfd_send_signal() should use assertRaisesRegex() rather than assertRaisesRegexp():

    $ ./python -Werror -m test -v test_signal -m test_pidfd_send_signal 
    (...)

    ======================================================================
    ERROR: test_pidfd_send_signal (test.test_signal.PidfdSignalTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/vstinner/python/master/Lib/test/test_signal.py", line 1292, in test_pidfd_send_signal
        with self.assertRaisesRegexp(TypeError, "^siginfo must be None$"):
      File "/home/vstinner/python/master/Lib/unittest/case.py", line 1390, in deprecated_func
        warnings.warn(
    DeprecationWarning: Please use assertRaisesRegex instead.

    @vstinner vstinner added 3.9 only security fixes tests Tests in the Lib/test dir easy labels Jan 22, 2020
    @vstinner vstinner changed the title test_signal: test_pidfd_send_signal() uses deprecated assertRaisesRegexp() method [easy] test_signal: test_pidfd_send_signal() uses deprecated assertRaisesRegexp() method Jan 24, 2020
    @vstinner vstinner changed the title test_signal: test_pidfd_send_signal() uses deprecated assertRaisesRegexp() method [easy] test_signal: test_pidfd_send_signal() uses deprecated assertRaisesRegexp() method Jan 24, 2020
    @hakancelik96
    Copy link
    Mannequin

    hakancelik96 mannequin commented Jan 27, 2020

    I want to work on this as my first contribution

    @serhiy-storchaka
    Copy link
    Member

    New changeset 38c878b by damani42 in branch 'master':
    bpo-39424: Use assertRaisesRegex instead of assertRaisesRegexp. (GH-18277)
    38c878b

    @vstinner
    Copy link
    Member Author

    Thanks damani42 for the fix!

    Hakan: "I want to work on this as my first contribution"

    I'm sorry for you, damani42 was faster than you to propose a PR! You can look for other "newcomer friendly" issues on the bug tracker by searching per keyword.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes easy tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants