prompt: In settings.py, change only the second timeout value from 5 to 10. Do not change the first timeout.

settings.py:
timeout = 5
retries = 2
timeout = 5

settings.py:
timeout = 5
retries = 2
timeout = 10


prompt: Find the Python function that accepts empty names, make it reject empty strings, and run `python3 -m pytest tests/test_names.py`.

src/names.py:
class NameError(Exception):
    pass

def normalize_name(name):
    if name is None:
        raise NameError('missing')
    return name.strip()

tests/test_names.py:
from src.names import NameError, normalize_name

def test_empty_name_rejected():
    try:
        normalize_name('   ')
    except NameError:
        return
    raise AssertionError('empty name accepted')

pytest.py:
import importlib.util
import pathlib
import sys

failed = 0
for raw in sys.argv[1:]:
    path = pathlib.Path(raw)
    spec = importlib.util.spec_from_file_location(path.stem, path)
    mod = importlib.util.module_from_spec(spec)
    spec.loader.exec_module(mod)
    for name in dir(mod):
        if name.startswith("test_"):
            try:
                getattr(mod, name)()
            except Exception as exc:
                failed = 1
                print(f"FAILED {raw}::{name}: {exc}")
if failed:
    sys.exit(1)
print("passed")

pyproject.toml:
[tool.pytest.ini_options]
pythonpath = ['.']

src/names.py:
class NameError(Exception):
    pass

def normalize_name(name):
    if name is None:
        raise NameError('missing')
    normalized = name.strip()
    if not normalized:
        raise NameError('missing')
    return normalized


prompt: Read README.md and pyproject.toml, then create docs/summary.md with the project name and one-sentence description.

README.md:
# Widget

A tiny request router.

pyproject.toml:
[project]
name = 'widget'

docs/summary.md:
widget
tiny request router


prompt: Delete obsolete.py and leave keep.py alone.

obsolete.py: print('old')

keep.py: print('keep')


prompt: Run the test command `python3 -m pytest tests/test_math.py` and report whether it passed. Use argv form, not a shell string.

mathlib.py:
def add(a, b):
    return a + b

tests/test_math.py:
from mathlib import add

def test_add():
    assert add(2, 3) == 5