Skip to content

Commit 7f0b79e

Browse files
committed
Merge bitcoin/bitcoin#27906: doc: test: update TestShell instructions
14405e8 doc: test: update TestShell instructions (ismaelsadeeq) Pull request description: Fixes #27904 From #27904 and IRC. Update [Testshell instructions ](https://github.com/bitcoin/bitcoin/blob/master/test/functional/test-shell.md#2-importing-testshell-from-the-bitcoin-core-repository) E.g `TestShell.setup()` throws ``` AttributeError: type object 'TestShell' has no attribute 'setup' ``` Parentheses are missing, it should be `TestShell().setup()` ACKs for top commit: Sjors: utACK 14405e8 brunoerg: crACK 14405e8 hernanmarino: utACK 14405e8 Tree-SHA512: ffe5fa1103a3b00ef0ee99879adae967b0da07cb8f8451c4c261b0a70b3b666af7aeaacd6f46f85a84ee5e9c7c7ed49700209b5b1f124d7a76efc420ad5c9cd9
2 parents f0758d8 + 14405e8 commit 7f0b79e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/functional/test-shell.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ importing the `TestShell` class from the `test_shell` sub-package.
3737
The following `TestShell` methods manage the lifetime of the underlying bitcoind
3838
processes and logging utilities.
3939

40-
* `TestShell.setup()`
41-
* `TestShell.shutdown()`
40+
* `TestShell().setup()`
41+
* `TestShell().shutdown()`
4242

4343
The `TestShell` inherits all `BitcoinTestFramework` members and methods, such
4444
as:
45-
* `TestShell.nodes[index].rpc_method()`
46-
* `TestShell.log.info("Custom log message")`
45+
* `TestShell().nodes[index].rpc_method()`
46+
* `TestShell().log.info("Custom log message")`
4747

4848
The following sections demonstrate how to initialize, run, and shut down a
4949
`TestShell` object.
@@ -143,7 +143,7 @@ instances and remove all temporary data and logging directories.
143143
20XX-XX-XXTXX:XX:XX.XXXXXXX TestFramework (INFO): Tests successful
144144
```
145145
To prevent the logs from being removed after a shutdown, simply set the
146-
`TestShell.options.nocleanup` member to `True`.
146+
`TestShell().options.nocleanup` member to `True`.
147147
```
148148
>>> test.options.nocleanup = True
149149
>>> test.shutdown()
@@ -162,9 +162,9 @@ underlying `BitcoinTestFramework`:
162162

163163
The `TestShell` object initializes with the default settings inherited from the
164164
`BitcoinTestFramework` class. The user can override these in
165-
`TestShell.setup(key=value)`.
165+
`TestShell().setup(key=value)`.
166166

167-
**Note:** `TestShell.reset()` will reset test parameters to default values and
167+
**Note:** `TestShell().reset()` will reset test parameters to default values and
168168
can be called after the TestShell is shut down.
169169

170170
| Test parameter key | Default Value | Description |
@@ -181,7 +181,7 @@ can be called after the TestShell is shut down.
181181
| `perf` | False | Profiles running nodes with `perf` for the duration of the test if set to `True`. |
182182
| `rpc_timeout` | `60` | Sets the RPC server timeout for the underlying bitcoind processes. |
183183
| `setup_clean_chain` | `False` | A 200-block-long chain is initialized from cache by default. Instead, `setup_clean_chain` initializes an empty blockchain if set to `True`. |
184-
| `randomseed` | Random Integer | `TestShell.options.randomseed` is a member of `TestShell` which can be accessed during a test to seed a random generator. User can override default with a constant value for reproducible test runs. |
184+
| `randomseed` | Random Integer | `TestShell().options.randomseed` is a member of `TestShell` which can be accessed during a test to seed a random generator. User can override default with a constant value for reproducible test runs. |
185185
| `supports_cli` | `False` | Whether the bitcoin-cli utility is compiled and available for the test. |
186186
| `tmpdir` | `"/var/folders/.../"` | Sets directory for test logs. Will be deleted upon a successful test run unless `nocleanup` is set to `True` |
187187
| `trace_rpc` | `False` | Logs all RPC calls if set to `True`. |

0 commit comments

Comments
 (0)