Skip to content

Commit be45445

Browse files
committed
refactor(config): use __msg for error messages
Renames the variable used for error messages from `msg` to `__msg` in to hide it from the public API.
1 parent 9b10980 commit be45445

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cardano_node_tests/utils/configuration.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
# Used also in startup scripts
3030
UTXO_BACKEND = os.environ.get("UTXO_BACKEND") or ""
3131
if UTXO_BACKEND not in ("", "mem", "disk", "disklmdb", "empty"):
32-
msg = f"Invalid UTXO_BACKEND: {UTXO_BACKEND}"
33-
raise RuntimeError(msg)
32+
__msg = f"Invalid UTXO_BACKEND: {UTXO_BACKEND}"
33+
raise RuntimeError(__msg)
3434
# Used also in startup scripts
3535
MIXED_UTXO_BACKENDS = os.environ.get("MIXED_UTXO_BACKENDS") or ""
3636

@@ -52,13 +52,13 @@
5252

5353
CLUSTER_ERA = os.environ.get("CLUSTER_ERA") or ""
5454
if CLUSTER_ERA not in ("", "conway"):
55-
msg = f"Invalid or unsupported CLUSTER_ERA: {CLUSTER_ERA}"
56-
raise RuntimeError(msg)
55+
__msg = f"Invalid or unsupported CLUSTER_ERA: {CLUSTER_ERA}"
56+
raise RuntimeError(__msg)
5757

5858
COMMAND_ERA = os.environ.get("COMMAND_ERA") or ""
5959
if COMMAND_ERA not in ("", "latest", "conway"):
60-
msg = f"Invalid COMMAND_ERA: {COMMAND_ERA}"
61-
raise RuntimeError(msg)
60+
__msg = f"Invalid COMMAND_ERA: {COMMAND_ERA}"
61+
raise RuntimeError(__msg)
6262

6363
XDIST_WORKERS_COUNT = int(os.environ.get("PYTEST_XDIST_WORKER_COUNT") or 0)
6464
MAX_TESTS_PER_CLUSTER = int(os.environ.get("MAX_TESTS_PER_CLUSTER") or 8)
@@ -73,8 +73,8 @@
7373

7474
NUM_POOLS = int(os.environ.get("NUM_POOLS") or 3)
7575
if not BOOTSTRAP_DIR and NUM_POOLS < 3:
76-
msg = f"Invalid NUM_POOLS '{NUM_POOLS}': must be >= 3"
77-
raise RuntimeError(msg)
76+
__msg = f"Invalid NUM_POOLS '{NUM_POOLS}': must be >= 3"
77+
raise RuntimeError(__msg)
7878

7979
HAS_DBSYNC = bool(os.environ.get("DBSYNC_SCHEMA_DIR"))
8080
HAS_SMASH = HAS_DBSYNC and helpers.is_truthy_env_var("SMASH")

0 commit comments

Comments
 (0)