Skip to content

Unit tests using r as a variable name are shaddowed by PDB commands #223

@julianstirling

Description

@julianstirling

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions