Unit tests using `r` as a variable name are shaddowed by PDB commands
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
Research direction
Start with the TestClient unit tests that assign responses to r, then reproduce the issue using the --pdb flag and a failing test. Rename the affected response variables so entering r in PDB no longer exits the debugger, and verify the unit tests still pass.
Written by the indexing model from the issue text.
Description
Describe the bug
Most code that uses TestClient gets a response from the server as r = client.get(...) [or similar for post requests. However, if we use pytests --pdb flag to drop into the terminal, it is impossible to read this value as r is one of the many single letter PDB commands.
It can be reassigned, but by this time you have accidentally returned as this is what r means in PDB
This is an easy fix, and will improve variable naming and test readability at the same time.
To Reproduce
Make a TestClient unit test fail with the --pdb flag. Try to read r by typing r. You will be returned out of PDB
Expected behaviour
The response should print.
System:
- OS: Kubuntu 24.04
- Python version: 3.11
- Version: 0.0.12
Additional context
Add any other context about the problem here.
- Dominant language
- Python
- Stars
- 9
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from labthings/labthings-fastapi
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
labthings/labthings-fastapi#405 ·
-
drop-python-version
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
labthings/labthings-fastapi#354 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
labthings/labthings-fastapi#312 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
labthings/labthings-fastapi#404 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 63/100
labthings/labthings-fastapi#403 · 1 comment ·
All issues in labthings/labthings-fastapi
Similar issues
-
area: harness bug status: needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Human-Agent-Society/reef#625 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
learningequality/kolibri#15351 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Name consistency Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
eellak/triplestore#65 · 1 comment ·