python / python/cpython

unittest's assertRaises removes locals from tracebacks

Open
#83,947 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

stdlib type-feature
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

BPO 39766
Nosy @blueyed, @jacksonriley

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 = None
created_at = <Date 2020-02-26.22:01:11.668>
labels = ['3.8', '3.7', 'library', '3.9']
title = "unittest's assertRaises removes locals from tracebacks"
updated_at = <Date 2021-05-11.13:38:40.113>
user = 'https://github.com/blueyed'

bugs.python.org fields:

activity = <Date 2021-05-11.13:38:40.113>
actor = 'jacksonriley'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2020-02-26.22:01:11.668>
creator = 'blueyed'
dependencies = []
files = []
hgrepos = []
issue_num = 39766
keywords = []
message_count = 3.0
messages = ['362744', '362753', '393457']
nosy_count = 2.0
nosy_names = ['blueyed', 'jacksonriley']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue39766'
versions = ['Python 3.5', 'Python 3.6', 'Python 3.7', 'Python 3.8', 'Python 3.9']

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the unittest assertRaises implementation and reproduce the reported traceback behavior with a minimal example. Trace how the context manager handles the exception and compare the resulting traceback locals; the issue is done when assertRaises no longer removes those locals.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.