TestShell doesn’t work #27904

issue Sjors openend this issue on June 16, 2023
  1. Sjors commented at 8:14 pm on June 16, 2023: member

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    Following the instructions here:

    https://github.com/bitcoin/bitcoin/blob/master/test/functional/test-shell.md#2-importing-testshell-from-the-bitcoin-core-repository

    0AttributeError: type object 'TestShell' has no attribute 'setup'
    

    Expected behaviour

    It should setup the TestShell

    Steps to reproduce

    Build binaries.

    On macOS:

    0$ python
    1Python 3.8.16 (default, May 19 2023, 13:41:40) 
    2[Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
    3>>> import sys
    4>>> sys.path.insert(0,"/home/sjors/dev/bitcoin/test/functional")
    5>>> from test_framework.test_shell import TestShell
    6>>> TestShell.setup()
    7Traceback (most recent call last):
    8  File "<stdin>", line 1, in <module>
    9AttributeError: type object 'TestShell' has no attribute 'setup'
    

    On Ubuntu:

    0ython 3.8.16 (default, May  8 2023, 15:02:46) 
    1[GCC 12.2.0] on linux
    2Type "help", "copyright", "credits" or "license" for more information.
    3>>> import sys
    4>>> sys.path.insert(0,"/home/sjors/dev/bitcoin/test/functional")
    5>>> from test_framework.test_shell import TestShell
    6>>> TestShell.setup()
    7Traceback (most recent call last):
    8  File "<stdin>", line 1, in <module>
    9AttributeError: type object 'TestShell' has no attribute 'setup'
    

    Relevant log output

    No response

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    master@f0758d8a6696657269d9c057e7aa079ffa9e1c16

    Operating system and version

    Ubuntu 23.04 / macOS 13.4

    Machine specifications

    Using Python 3.8.16 on both. macOS is on an Intel machine. Python is installed via PyEnv. I’m not using a virtual environment.

  2. Sjors commented at 8:18 pm on June 16, 2023: member

    From IRC:

    0[@theStack](/bitcoin-bitcoin/contributor/thestack/): seems like the parantheses are missing and it should be `TestShell().setup()` instead of `TestShell.setup()` (i.e. it's not a class method, but needs an instance)
    

    (instructions need updating, will open a PR later if nobody else does)

  3. Sjors closed this on Jun 16, 2023

  4. ismaelsadeeq commented at 9:50 pm on June 16, 2023: member
    Tested and it works on pop-OS 22.04, with Python 3.10.6, I would update the TestShell instruction. 👍🏾
  5. fanquake referenced this in commit 7f0b79ea13 on Jun 18, 2023
  6. bitcoin locked this on Jun 15, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-10-10 21:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me