Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ instead of ``pdb``. (It does not depend on ``ipdb`` anymore).
pytest
+++++++
pytest_ supports a ``--pdb`` option which can run ``ipdb`` /
``IPython.terminal.debugger:Pdb`` on ``Exception`` and ``breakpoint()``:
``IPython.terminal.debugger:TerminalPdb`` on ``Exception`` and ``breakpoint()``:

.. code:: bash

pytest --pdb --pdbcls=IPython.terminal.debugger:Pdb -v ./test_example.py
pytest --pdb --pdbcls=IPython.terminal.debugger:TerminalPdb -v ./test_example.py

You don't need to specify ``--pdbcls`` for every ``pytest`` invocation
if you add ``addopts`` to ``pytest.ini`` or ``pyproject.toml``.
Expand All @@ -210,14 +210,14 @@ if you add ``addopts`` to ``pytest.ini`` or ``pyproject.toml``.
.. code:: bash

[tool.pytest.ini_options]
addopts = "--pdbcls=IPython.terminal.debugger:Pdb"
addopts = "--pdbcls=IPython.terminal.debugger:TerminalPdb"

``pyproject.toml``:

.. code:: yml

[tool.pytest.ini_options]
addopts = "--pdbcls=IPython.terminal.debugger:Pdb"
addopts = "--pdbcls=IPython.terminal.debugger:TerminalPdb"
Comment on lines +213 to +220
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, find and examine README.rst at the specified lines
fd -n "README.rst" -x cat -n {} | sed -n '210,225p'

Repository: gotcha/ipdb

Length of output: 285


🌐 Web query:

pytest.ini syntax configuration section header format

💡 Result:

In a pytest.ini (INI syntax), the pytest configuration must be under the section header:

[pytest]

Example:

[pytest]
addopts = -ra -q
testpaths =
    tests

Related formats (different headers): tox.ini also uses [pytest], while setup.cfg uses [tool:pytest]. [1]

Sources: [1] (docs.pytest.org)

Citations:


🌐 Web query:

pyproject.toml tool.pytest.ini_options configuration format

💡 Result:

In pyproject.toml, pytest supports an INI-style configuration table named:

[tool.pytest.ini_options]

This table is the TOML equivalent of the [pytest] section in pytest.ini: keys are normal pytest INI options (e.g. addopts, testpaths, minversion, markers, filterwarnings, etc.). Example: (docs.pytest.org)

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -q"
testpaths = ["tests", "integration"]
xfail_strict = true
filterwarnings = ["error"]
markers = [
  "slow: mark slow tests",
]

Notes:

  • Use TOML scalars/arrays as shown (strings, booleans, lists of strings). (docs.pytest.org)
  • Since pytest 9.0, you can alternatively use [tool.pytest] to “leverage native TOML types”; [tool.pytest.ini_options] remains available for the INI-style mapping. (docs.pytest.org)

Citations:


🏁 Script executed:

# Find README.rst and show lines 210-225
find . -name "README.rst" -type f -exec sed -n '210,225p' {} +

Repository: gotcha/ipdb

Length of output: 335


🏁 Script executed:

# Show lines 205-225 to see section context
find . -name "README.rst" -type f -exec sed -n '205,225p' {} +

Repository: gotcha/ipdb

Length of output: 489


Fix pytest.ini example to use correct INI format syntax.

The first code block under pytest.ini (lines 213) incorrectly shows TOML syntax [tool.pytest.ini_options], which belongs only to pyproject.toml. The pytest.ini example should use INI format with the [pytest] section header:

Corrected example
[pytest]
addopts = "--pdbcls=IPython.terminal.debugger:TerminalPdb"

The pyproject.toml example is correct as-is.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.rst` around lines 213 - 220, The README shows TOML-style
`[tool.pytest.ini_options]` in the pytest.ini example; update the pytest.ini
code block to use proper INI syntax by replacing the section header with
`[pytest]` and keep the `addopts =
"--pdbcls=IPython.terminal.debugger:TerminalPdb"` line unchanged, while leaving
the `pyproject.toml` example as-is; ensure you edit the pytest.ini example block
(the one containing `addopts`) so it uses `[pytest]` as the section header.



.. _pytest: https://pypi.python.org/pypi/pytest