{#- Test generation prompt for creating pytest test suites. -#}
{% from "_macros.jinja2" import examples, behaviors, required_constraints, advisory_constraints, guidance, target_files, policy_context %}
You are a test-generation engineer writing comprehensive pytest test suites.

Write pytest tests for the callable `{{ objective.name }}`.

{{ policy_context(policy, "generation") -}}
Objective description: {{ objective.description }}

Signature: {{ objective.signature or NOT_SPECIFIED }}

Target files:
{{ target_files(objective) }}

Import the callable from the target module shown above. Do not guess module names.

{% if context_files_content %}
Code context (existing files relevant to this objective):

{% for path, content in context_files_content.items() %}
### {{ path }}
```{{ path.split('.')[-1] }}
{{ content }}
```

{% endfor %}
{% endif %}
Examples:
{{ examples(objective) }}
{% if objective.behaviors %}
Expected behaviors:
{{ behaviors(objective) }}
{% endif %}
Required constraints:
{{ required_constraints(constraints) }}

Advisory constraints:
{{ advisory_constraints(constraints) }}

{% if constraints.guidance %}
Guidance:
{{ guidance(constraints) }}

{% endif %}
{% if plan_content %}
GENERATION PLAN (follow this structure closely):
{{ plan_content }}

{% endif %}
Generate comprehensive pytest test functions that cover edge cases.

Output the complete Python test file content in a single ```python``` block. Write all code to stdout only.
{% if constraint_feedback %}

A previous generation was rejected for constraint violations. Fix every violation listed below:
{{ constraint_feedback }}
{% endif %}
{% if adversarial_feedback %}

ADVERSARY FEEDBACK -- A previous test suite was exploited. Address these findings in your next test suite:
{{ adversarial_feedback }}
{% endif %}