Skip to content

generate_report() sometimes gives TypeError: sequence item 0: expected str instance, list found #19

Description

@bengerman13

Describe the bug
For some, but not all, reports, I'm seeing this error:

    def __violation_report(self, violation: dict, template: Template) -> str:
        nodes_str = ""
        for num, node in enumerate(violation["nodes"], start=1):
>           targets = ", ".join(node["target"])
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
E           TypeError: sequence item 0: expected str instance, list found

To Reproduce

Steps to reproduce the behavior:

  1. check out: https://github.com/pycascades/pycascades-2026/tree/39a2096a0edda50c3161cba6b5be232e87b462a6
  2. uv run --with-requirements tests/requirements.txt pytest tests

Expected behavior
When findings are found, the assert here should print the findings

Logs
As a workaround, I dumped the results here:
results.txt

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions