We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b7b146 commit eb4ee23Copy full SHA for eb4ee23
tests/test_cli.py
@@ -3,6 +3,7 @@
3
"""
4
5
import json
6
+import ast
7
import subprocess
8
import pytest
9
import datajoint as dj
@@ -60,21 +61,8 @@ def test_cli_config():
60
61
process.stdin.flush()
62
63
stdout, stderr = process.communicate()
-
64
- snippet = stdout[4:519]
65
- assert snippet
66
- assert isinstance(snippet, str)
67
- try:
68
- assert dj.config == json.loads(
69
- snippet.replace("'", '"')
70
- .replace("None", "null")
71
- .replace("True", "true")
72
- .replace("False", "false")
73
- )
74
- except Exception as e:
75
- print(snippet)
76
- print(stdout)
77
- raise AssertionError(f"Error decoding JSON {snippet=}") from e
+ cleaned = stdout.strip(" >\t\n\r")
+ assert dj.config == ast.literal_eval(cleaned)
78
79
80
def test_cli_args():
0 commit comments