Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PexpectLibrary initialization fails: Union cannot be empty #351

Open
@csanchezdll

Description

@csanchezdll

Using PexpectLibrary (https://github.com/lipan-sudo/PexpectLibrary) in RF 7.3 yields an error during initialization and some of the keywords fail to be registered:

docker run -ti ubuntu:22.04[...]# apt install pip[...]# pip install robotframework==7.3[...]# pip install PexpectLibrary==0.2.0[...]# cat test.robotroot@14df3f2e8fa5:/test# cat test.robot *** Settings ***Library    PexpectLibrary*** Test Cases ***Test    ${proc}    Spawn    cat# robot .==============================================================================Test                                                                          ==============================================================================[ ERROR ] Error in library 'PexpectLibrary': Adding keyword 'popen_spawn' failed: Union cannot be empty.[ ERROR ] Error in library 'PexpectLibrary': Adding keyword 'spawn' failed: Union cannot be empty.Test.Test                                                                     ==============================================================================Test                                                                  | FAIL |No keyword with name 'Spawn' found. Did you mean:    PexpectLibrary.Spawnu    PexpectLibrary.Fd Spawn------------------------------------------------------------------------------Test.Test                                                             | FAIL |1 test, 0 passed, 1 failed==============================================================================Test                                                                  | FAIL |1 test, 0 passed, 1 failed==============================================================================Output:  /test/output.xmlLog:     /test/log.htmlReport:  /test/report.html

Related past problem:https://forum.robotframework.org/t/error-in-faker-library/6743

I have debugged this to the keyword argument validation logic detecting a problem onpreexec_fn: Optional[Callable[[], Any]] = None, (https://github.com/lipan-sudo/PexpectLibrary/blob/384794dc4b917d08963cfb95d7a6a135b4f8dfec/PexpectLibrary/__init__.py#L118C15-L118C62). Removing the type hints make the keywords register successfully, but AFAIU the hints are valid and the problem is on how RF fails validation there.

Note that RF 7.2.2 did not exhibit this problem:

# pip install robotframework==7.2.2[...]# robot .==============================================================================Test                                                                          ==============================================================================Test.Test                                                                     ==============================================================================Test                                                                  | PASS |------------------------------------------------------------------------------Test.Test                                                             | PASS |1 test, 1 passed, 0 failed==============================================================================Test                                                                  | PASS |1 test, 1 passed, 0 failed==============================================================================Output:  /test/output.xmlLog:     /test/log.htmlReport:  /test/report.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp