Skip to content

Conversation

seratch
Copy link
Member

@seratch seratch commented Jul 11, 2025

With recent realtime module related code additions, the current main branch fails due to test coverage (93%, which misses 95% target). This prevents new contributions. We can add tests and hit 95% later on, but for now, changing the config should be a reasonable choice.

@seratch seratch requested a review from rm-openai July 11, 2025 22:59
@seratch seratch added the enhancement New feature or request label Jul 11, 2025
@seratch
Copy link
Member Author

seratch commented Jul 11, 2025

The old_versions test failure looks another issue:

============================= test session starts ==============================
platform linux -- Python 3.9.23, pytest-8.3.5, pluggy-1.5.0
rootdir: /home/runner/work/openai-agents-python/openai-agents-python
configfile: pyproject.toml
plugins: inline-snapshot-0.22.3, mock-3.14.0, asyncio-0.26.0, anyio-4.9.0
asyncio: mode=auto, asyncio_default_fixture_loop_scope=session, asyncio_default_test_loop_scope=function
collected 397 items / 2 errors

═══════════════════════════════ inline-snapshot ════════════════════════════════
INFO: CI run was detected because environment variable "CI" was defined.
INFO: inline-snapshot runs with --inline-snapshot=disabled by default in CI.

==================================== ERRORS ====================================
________________ ERROR collecting tests/realtime/test_agent.py _________________
tests/realtime/test_agent.py:4: in <module>
    from agents.realtime.agent import RealtimeAgent
src/agents/realtime/__init__.py:2: in <module>
    from .config import APIKeyOrKeyFunc
src/agents/realtime/config.py:74: in <module>
    APIKeyOrKeyFunc = str | Callable[[], MaybeAwaitable[str]]
E   TypeError: unsupported operand type(s) for |: 'type' and '_CallableGenericAlias'
___________ ERROR collecting tests/realtime/test_transport_events.py ___________
tests/realtime/test_transport_events.py:3: in <module>
    from agents.realtime.transport_events import RealtimeTransportEvent
src/agents/realtime/__init__.py:2: in <module>
    from .config import APIKeyOrKeyFunc
src/agents/realtime/config.py:74: in <module>
    APIKeyOrKeyFunc = str | Callable[[], MaybeAwaitable[str]]
E   TypeError: unsupported operand type(s) for |: 'type' and '_CallableGenericAlias'
=========================== short test summary info ============================
ERROR tests/realtime/test_agent.py - TypeError: unsupported operand type(s) for |: 'type' and '_CallableGenericAlias'
ERROR tests/realtime/test_transport_events.py - TypeError: unsupported operand type(s) for |: 'type' and '_CallableGenericAlias'
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 2 errors in 1.36s ===============================
make: *** [Makefile:43: old_version_tests] Error 2
Error: Process completed with exit code 2.

https://github.com/openai/openai-agents-python/actions/runs/16231269681/job/45834418871?pr=1077

@seratch seratch changed the title Change test coverage fail-under from 95 to 90 Resolve CI failures with main branch Jul 11, 2025
@seratch
Copy link
Member Author

seratch commented Jul 11, 2025

Resolved all the failures:

  • test coverage requirements: 95 -> 90 (currently 93)
  • modify some of the added realtime module code to be compatible with python 3.9

Copy link
Collaborator

@rm-openai rm-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just going to fix forward - I wanted to merge bc it's a pain to add tests to a large PR, but I want to fix by EOD

@seratch
Copy link
Member Author

seratch commented Jul 12, 2025

OK, thanks!

@seratch seratch closed this Jul 12, 2025
@seratch seratch deleted the test-coverage branch September 9, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants