pynguin icon indicating copy to clipboard operation
pynguin copied to clipboard

Improve dict generation for key-dependent branches

Open Shikaikai02 opened this issue 2 months ago • 2 comments

Hi, I’m exploring the input space of Python APIs for a research project. Many of the functions I target accept **kwargs or other dictionary parameters. Currently Pynguin builds dicts at random, so code like

def foo(d: dict[str, int]):
    if d['k'] == 10: ...

never enters the if. Do you have any plans to treat constant keys ('k') as guidance hints, as scalars already are? This would greatly help coverage for dict-heavy APIs. Thanks!

Shikaikai02 avatar Nov 18 '25 07:11 Shikaikai02