Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions tests/e2e_tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import inspect
import os
import re
import shutil
Expand Down Expand Up @@ -32,6 +33,27 @@ def exec_command(
):
extra_args = extra_args or []
cli_manager = CLIManager()
for group in cli_manager.app.registered_groups:
if group.name == command:
for command_ in group.typer_instance.registered_commands:
if command_.name == sub_command:
if "network" in inspect.getcallargs(
command_.callback
).keys() and not any(
(
x in extra_args
for x in (
"--network",
"--chain",
"--subtensor.network",
"--subtensor.chain_endpoint",
)
)
):
# Ensure if we forget to add `--network ws://127.0.0.1:9945` that it will run still
# using the local chain
extra_args.extend(["--network", "ws://127.0.0.1:9945"])

# Capture stderr separately from stdout
runner = CliRunner(mix_stderr=False)
# Prepare the command arguments
Expand Down
Loading