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

Sticky by default not working with pytest #486

Open
JoshCLWren opened this issue May 1, 2022 · 7 comments
Open

Sticky by default not working with pytest #486

JoshCLWren opened this issue May 1, 2022 · 7 comments
Labels

Comments

@JoshCLWren
Copy link

Recently I've noticed that when placing a debugger inside a test I am not greeted with pdbpp's wonderful sticky mode which I have as an always on default in my pdbrc but instead I'm greeted with this:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB set_trace (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[39] > /Users/joshwren/REDACTED/main.py(60)get_app()
-> app = aiohttp.web.Application(
   5 frames hidden (try 'help hidden_frames')
> /Users/joshwren/REDACTED/main.py(60)

** Error in inspect.getsourcelines: 'function' object has no attribute 'endswith' **
(Pdb++)

Now this is not catastrophic as I am indeed inside my lovely python debugger of choice and if I were to use the next keyword the debugger would suddenly be in sticky mode but just one line later than I intended. I've localized the issue to be happening only when debugging inside pytest as my sticky by default works in any other non pytest capacity. I've tried googling this every few days but to no avail. Also of note is that I've recently switched to an m1 mac which has been full of incompatibility challenges that have been stubborn but not impossible to fix so I would not be surprised to find this to be a side effect related to apple silicon as none of my other python peers use the same cpu.

pdbpp==0.10.3
pytest==7.1.2

@JoshCLWren
Copy link
Author

JoshCLWren commented Jun 7, 2022

This is happening to all my team mates that use an M1 Mac like myself and I'm wondering what if PDBPP anything has to do with that. Python version is 3.8.7 by the way.

@JoshCLWren
Copy link
Author

I had the pleasure of working in an older repo this week that had a working version of pdbpp and pytest at the same time. It brought joy to an otherwise dark place. Any word on this?

@calebhubbs
Copy link

I am also having the same issue as well. It is not working with M1 mac's very nicely.

@blueyed blueyed added the bug label Jun 30, 2022
@dcmoss87
Copy link

I'm also having the same issue on an M1.

@jamilraichouni
Copy link

jamilraichouni commented Sep 11, 2022

Here, it works when I call a test this way:

python -mpdb -c 'c' -m pytest --trace --pdb /path/to/my/test_module.py::my_test

and have a file ~/.pdbrc.py with the following content:

import pdb

class Config(pdb.DefaultConfig):
    sticky_by_default = True

What I'm using:

$ pip show pdbpp
Name: pdbpp
Version: 0.10.3
Summary: pdb++, a drop-in replacement for pdb
Home-page: http://github.com/antocuni/pdb
Author: Antonio Cuni
Author-email: anto.cuni@gmail.com
License: BSD
Location: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages
Requires: fancycompleter, pygments, wmctrl
Required-by:

@JoshCLWren
Copy link
Author

@jamilraichouni I revisit this every few months. Still doesn't work and I'm wondering if I'm one of the only people still caring about this. I wanted to let you know I've duplicated your exact versions and pdbrc and when I run your command I still get the same errors.

@blueyed
Copy link
Collaborator

blueyed commented Feb 20, 2023

Please try pdb++ from the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants