Skip to content

Add Listener API v3 pre-import callbacks - #5771

Open
sunilkumarvalmiki wants to merge 1 commit into
robotframework:masterfrom
sunilkumarvalmiki:codex/issue-5667-pre-import
Open

sunilkumarvalmiki wants to merge 1 commit into
robotframework:masterfrom
sunilkumarvalmiki:codex/issue-5667-pre-import

Conversation

@sunilkumarvalmiki

@sunilkumarvalmiki sunilkumarvalmiki commented Aug 29, 2026 •

Copy link
Copy Markdown

Summary

  • Add Listener API v3 start_*_import callbacks for libraries, resources, and variable files.
  • Pass the mutable import model before name/argument resolution so listeners can change the import target, arguments, and library alias.
  • Fix Windows path-plus-arguments parsing when an existing path contains parent segments; this restores the custom-console logger regression.

Tests

  • python -m pytest utest\\output utest\\running\\test_namespace.py utest\\utils\\test_text.py -q — 181 passed, 3 existing collection warnings.
  • python -m unittest utest.output.test_listeners_issue5667 utest.running.test_namespace_issue5667 — 3 passed.
  • atest/run.py --exclude no-ci atest/robot/output/listener_interface/listening_imports.robot — 3 passed.
  • python -m compileall on changed sources and tests — passed.
  • Ruff on new tests and parser regression — passed.

The implementation follows Option 1 described in #5667 and leaves existing
after-import events unchanged.

Closes #5667

@pekkaklarck

Copy link
Copy Markdown
Member

Thanks for the PR! Unfortunately it's too late to get big enhancements like this to RF 7.5 anymore. I'll take a look at this when we start RF 7.6 (or RF 8.0) development.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend listener with pre-import events

2 participants