openai-agents-python/tests
Kazuhiro Sera 25f97f979b
Fix typos and misspellings (#486)
Detected typos using typos-cli (https://crates.io/crates/typos-cli). It
detected "occured" in a string constant "handoff_occured" too, but I
didn't change the part this time because it could be a minor breaking
change.


Full outputs:
```
% typos .
error: `Supresses` should be `Suppresses`
  --> ./src/agents/function_schema.py:134:7
    |
134 |     # Supresses warnings about missing annotations for params
    |       ^^^^^^^^^
    |
error: `typ` should be `typo`, `type`
  --> ./src/agents/strict_schema.py:51:5
   |
51 |     typ = json_schema.get("type")
   |     ^^^
   |
error: `typ` should be `typo`, `type`
  --> ./src/agents/strict_schema.py:52:8
   |
52 |     if typ == "object" and "additionalProperties" not in json_schema:
   |        ^^^
   |
error: `typ` should be `typo`, `type`
  --> ./src/agents/strict_schema.py:55:9
   |
55 |         typ == "object"
   |         ^^^
   |
error: `occured` should be `occurred`
  --> ./src/agents/stream_events.py:34:18
   |
34 |         "handoff_occured",
   |                  ^^^^^^^
   |
error: `occured` should be `occurred`
  --> ./src/agents/_run_impl.py:723:69
    |
723 |                 event = RunItemStreamEvent(item=item, name="handoff_occured")
    |                                                                     ^^^^^^^
    |
error: `desitnation` should be `destination`
  --> ./src/agents/tracing/span_data.py:171:25
    |
171 |     Includes source and desitnation agents.
    |                         ^^^^^^^^^^^
    |
error: `exmaples` should be `examples`
  --> ./docs/scripts/translate_docs.py:71:145
   |
71 |         "* The term 'examples' must be code examples when the page mentions the code examples in the repo, it can be translated as either 'code exmaples' or 'sample code'.",
   |                                                                                                                                                 ^^^^^^^^
   |
error: `structed` should be `structured`
  --> ./tests/test_agent_hooks.py:227:16
    |
227 | async def test_structed_output_non_streamed_agent_hooks():
    |                ^^^^^^^^
    |
error: `structed` should be `structured`
  --> ./tests/test_agent_hooks.py:298:16
    |
298 | async def test_structed_output_streamed_agent_hooks():
    |                ^^^^^^^^
    |
```
2025-04-14 10:37:13 -04:00
..
mcp Ensure MCP works when inputSchema.properties is missing (#454) 2025-04-07 18:38:36 -04:00
tracing Read tracing API data lazily 2025-03-21 15:32:37 -04:00
voice [2/n] Add MCP support to Runner 2025-03-24 15:08:02 -04:00
__init__.py Initial commit 2025-03-11 09:42:28 -07:00
conftest.py Initial commit 2025-03-11 09:42:28 -07:00
fake_model.py Make the reset behavior on tool use configurable 2025-03-25 13:29:32 -04:00
README.md Pretty print result classes 2025-03-17 11:11:39 -04:00
test_agent_config.py Initial commit 2025-03-11 09:42:28 -07:00
test_agent_hooks.py Fix typos and misspellings (#486) 2025-04-14 10:37:13 -04:00
test_agent_runner.py Convert MCP schemas to strict where possible (#414) 2025-04-01 16:50:13 -04:00
test_agent_runner_streamed.py fix typos in tests 2025-03-20 11:24:15 +01:00
test_agent_tracing.py More fetch_normalized_spans 2025-03-21 18:31:06 +02:00
test_computer_action.py Initial commit 2025-03-11 09:42:28 -07:00
test_config.py make format 2025-03-11 14:54:10 -07:00
test_doc_parsing.py Initial commit 2025-03-11 09:42:28 -07:00
test_extension_filters.py Initial commit 2025-03-11 09:42:28 -07:00
test_function_schema.py Raise error on more invalid function schemas (#356) 2025-03-26 15:52:19 -04:00
test_function_tool.py Introduce tool_use_behavior on agents 2025-03-18 21:55:12 -04:00
test_function_tool_decorator.py Misc small fixes - mcp version, test for function_schema, version gen (#429) 2025-04-03 12:08:01 -04:00
test_global_hooks.py fix typos in tests 2025-03-20 11:24:15 +01:00
test_guardrails.py Initial commit 2025-03-11 09:42:28 -07:00
test_handoff_tool.py Initial commit 2025-03-11 09:42:28 -07:00
test_items_helpers.py pin to openai 1.66.2, update tests 2025-03-11 15:26:06 -07:00
test_max_turns.py Initial commit 2025-03-11 09:42:28 -07:00
test_openai_chatcompletions.py add overwrite mechanism for stream_options (#465) 2025-04-10 16:54:00 -04:00
test_openai_chatcompletions_converter.py refactor: update formatting in test_assistant_messages_in_history 2025-03-13 00:20:59 +05:00
test_openai_chatcompletions_stream.py Fix streaming in chat completions 2025-03-12 17:17:07 -07:00
test_openai_responses_converter.py pin to openai 1.66.2, update tests 2025-03-11 15:26:06 -07:00
test_output_tool.py utils directory 2025-03-16 18:48:45 -04:00
test_pretty_print.py Pretty print result classes 2025-03-17 11:11:39 -04:00
test_responses.py Initial commit 2025-03-11 09:42:28 -07:00
test_responses_tracing.py More fetch_normalized_spans 2025-03-21 18:31:06 +02:00
test_result_cast.py Initial commit 2025-03-11 09:42:28 -07:00
test_run_config.py Initial commit 2025-03-11 09:42:28 -07:00
test_run_step_execution.py [2/n] Add MCP support to Runner 2025-03-24 15:08:02 -04:00
test_run_step_processing.py [2/n] Add MCP support to Runner 2025-03-24 15:08:02 -04:00
test_strict_schema.py Initial commit 2025-03-11 09:42:28 -07:00
test_tool_choice_reset.py Make the reset behavior on tool use configurable 2025-03-25 13:29:32 -04:00
test_tool_converter.py Initial commit 2025-03-11 09:42:28 -07:00
test_tool_use_behavior.py Introduce tool_use_behavior on agents 2025-03-18 21:55:12 -04:00
test_trace_processor.py Initial commit 2025-03-11 09:42:28 -07:00
test_tracing.py More fetch_normalized_spans 2025-03-21 18:31:06 +02:00
test_tracing_errors.py Convert MCP schemas to strict where possible (#414) 2025-04-01 16:50:13 -04:00
test_tracing_errors_streamed.py Mark handoff span as errored when multiple handoffs are requested (#344) 2025-03-26 10:44:59 -04:00
test_visualization.py Refactor visualization functions to improve formatting and streamline edge generation 2025-03-25 19:12:40 +01:00
testing_processor.py More fetch_normalized_spans 2025-03-21 18:31:06 +02:00

Tests

Before running any tests, make sure you have uv installed (and ideally run make sync after).

Running tests

make tests

Snapshots

We use inline-snapshots for some tests. If your code adds new snapshot tests or breaks existing ones, you can fix/create them. After fixing/creating snapshots, run make tests again to verify the tests pass.

Fixing snapshots

make snapshots-fix

Creating snapshots

make snapshots-update