

@pytest.mark.parametrize('value,expected', [('None', None), ('True', True), ('False', False), ('246', 246), ('1.0', 1.0), ('1.', 1.0), ('.1', 0.1), ('1e3', 1000.0), ('-.4e-12', (- 4e-13)), ('-.4e-12', (- 4e-13)), ('[1,2,3]', [1, 2, 3]), ('[1.,.1]', [1.0, 0.1]), ('[True, False]', [True, False]), ('[None, None]', [None, None]), ('[1.0,2.0,3.0]', [1.0, 2.0, 3.0]), ('{"a":1}', {
    'a': 1,
}), ('{"foo":1, "bar":2.0}', {
    'foo': 1,
    'bar': 2.0,
}), ('{"a":1., "b":.2}', {
    'a': 1.0,
    'b': 0.2,
}), ('{"a":True, "b":False}', {
    'a': True,
    'b': False,
}), ('{"a":None}', {
    'a': None,
}), ('{"a":[1, 2.0, True, None], "b":"foo"}', {
    'a': [1, 2.0, True, None],
    'b': 'foo',
}), ('bob', 'bob'), ('"hello world"', 'hello world'), ("'hello world'", 'hello world')])
def test_convert_value(value, expected):
    assert (_convert_value(value) == expected)

dataset/ETHPy150Open IDSIA/sacred/tests/test_arg_parser.py test_convert_value/original