Skip to content

Minor bug in nesting #180

@iory

Description

@iory

There is a minor bug at the nesting case.
Following is the example.

import time
import pysnooper

snoop = pysnooper.snoop()

def test():
    with snoop:
        a = 10
        with snoop:
            time.sleep(1.0)
        a = 20
        time.sleep(1.0)


test()

The output is the following.

Source path:... <ipython-input-2-9ee7fdb55b80>
22:57:41.232785 line        11         a = 10
New var:....... a = 10
22:57:41.232850 line        12         with snoop:
22:57:41.232936 line        13             time.sleep(1.0)

The debug outputs of the a = 20 and time.sleep(1.0) are vanished.
I don't think we'll use it like this, but I'll report it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions