aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-06-18 12:47:50 +0200
committerfanquake <fanquake@gmail.com>2023-06-18 12:48:46 +0200
commit7f0b79ea132d22ad5212c1d3ff4325715ca5ac12 (patch)
tree1935b7a79b5199dda066d69ff0cea4ae37e099bc
parentf0758d8a6696657269d9c057e7aa079ffa9e1c16 (diff)
parent14405e8d4d259c18a21fc006d0a27550be3171f8 (diff)
downloadbitcoin-7f0b79ea132d22ad5212c1d3ff4325715ca5ac12.tar.xz
Merge bitcoin/bitcoin#27906: doc: test: update TestShell instructions
14405e8d4d259c18a21fc006d0a27550be3171f8 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 14405e8d4d259c18a21fc006d0a27550be3171f8 brunoerg: crACK 14405e8d4d259c18a21fc006d0a27550be3171f8 hernanmarino: utACK 14405e8d4d259c18a21fc006d0a27550be3171f8 Tree-SHA512: ffe5fa1103a3b00ef0ee99879adae967b0da07cb8f8451c4c261b0a70b3b666af7aeaacd6f46f85a84ee5e9c7c7ed49700209b5b1f124d7a76efc420ad5c9cd9
-rw-r--r--test/functional/test-shell.md16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/functional/test-shell.md b/test/functional/test-shell.md
index 80f4e88109..b89b40f13d 100644
--- a/test/functional/test-shell.md
+++ b/test/functional/test-shell.md
@@ -37,13 +37,13 @@ importing the `TestShell` class from the `test_shell` sub-package.
The following `TestShell` methods manage the lifetime of the underlying bitcoind
processes and logging utilities.
-* `TestShell.setup()`
-* `TestShell.shutdown()`
+* `TestShell().setup()`
+* `TestShell().shutdown()`
The `TestShell` inherits all `BitcoinTestFramework` members and methods, such
as:
-* `TestShell.nodes[index].rpc_method()`
-* `TestShell.log.info("Custom log message")`
+* `TestShell().nodes[index].rpc_method()`
+* `TestShell().log.info("Custom log message")`
The following sections demonstrate how to initialize, run, and shut down a
`TestShell` object.
@@ -143,7 +143,7 @@ instances and remove all temporary data and logging directories.
20XX-XX-XXTXX:XX:XX.XXXXXXX TestFramework (INFO): Tests successful
```
To prevent the logs from being removed after a shutdown, simply set the
-`TestShell.options.nocleanup` member to `True`.
+`TestShell().options.nocleanup` member to `True`.
```
>>> test.options.nocleanup = True
>>> test.shutdown()
@@ -162,9 +162,9 @@ underlying `BitcoinTestFramework`:
The `TestShell` object initializes with the default settings inherited from the
`BitcoinTestFramework` class. The user can override these in
-`TestShell.setup(key=value)`.
+`TestShell().setup(key=value)`.
-**Note:** `TestShell.reset()` will reset test parameters to default values and
+**Note:** `TestShell().reset()` will reset test parameters to default values and
can be called after the TestShell is shut down.
| Test parameter key | Default Value | Description |
@@ -181,7 +181,7 @@ can be called after the TestShell is shut down.
| `perf` | False | Profiles running nodes with `perf` for the duration of the test if set to `True`. |
| `rpc_timeout` | `60` | Sets the RPC server timeout for the underlying bitcoind processes. |
| `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`. |
-| `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. |
+| `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. |
| `supports_cli` | `False` | Whether the bitcoin-cli utility is compiled and available for the test. |
| `tmpdir` | `"/var/folders/.../"` | Sets directory for test logs. Will be deleted upon a successful test run unless `nocleanup` is set to `True` |
| `trace_rpc` | `False` | Logs all RPC calls if set to `True`. |