Skip to content

TestFramework: TestShell.reset() will always fail #31131

@edilmedeiros

Description

@edilmedeiros

TestShell documentation mentions a TestShell.reset() method.

When experimenting with it, it will always fail with:

Traceback (most recent call last):
  File "/Users/jose.edil/2-development/bitcoin/vinteum/foss-program/infra-signet-server/signet-server.py", line 169, in <module>
    TestShell().reset()
  File "/Users/jose.edil/2-development/bitcoin/bitcoin-core-build/test/functional/test_framework/test_shell.py", line 64, in reset
    super().__init__()
TypeError: BitcoinTestFramework.__init__() missing 1 required positional argument: 'test_file'

Indeed, inspecting the source code, we see that TestShell is a wrapper class for BitcoinTestFramework. TestShell.reset() will call super().__init__() which refers to BitcoinTestFramework.__init__().

But we only have def __init__(self, test_file) -> None: which will require a mandatory test_file parameter. (https://github.com/bitcoin/bitcoin/blob/28ce159bc327e6dfec34077ff2e379b23a95db65/test/functional/test_framework/test_framework.py#L95C5-L95C43).

Not sure if TestShell.reset() should change to receive this parameter and pass along to the __init__() function it calls internally or any other workaround. In my specific case, I can't see what I can pass as test_file.

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