aragilar / stringtopy

Assert statement used outside of tests BAN-B101
Security
Major
4 years ago4 years old
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
10
11def test_not_float_with_none():
12    str_to_float = str_to_float_converter(use_none_on_fail=True)
13    assert str_to_float("this is not a float") is None14
15def test_decimal(default_str_to_float):
16    assert default_str_to_float("1.234") == 1.234
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
13    assert str_to_float("this is not a float") is None
14
15def test_decimal(default_str_to_float):
16    assert default_str_to_float("1.234") == 1.23417
18def test_exp_notation(default_str_to_float):
19    assert default_str_to_float("5.76e7") == 5.76e7
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
16    assert default_str_to_float("1.234") == 1.234
17
18def test_exp_notation(default_str_to_float):
19    assert default_str_to_float("5.76e7") == 5.76e720
21def test_fraction(default_str_to_float):
22    assert 3 / 2 == default_str_to_float("3/2")
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
19    assert default_str_to_float("5.76e7") == 5.76e7
20
21def test_fraction(default_str_to_float):
22    assert 3 / 2 == default_str_to_float("3/2")23
24@pytest.mark.xfail
25def test_fraction_with_spaces(default_str_to_float):
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
23
24@pytest.mark.xfail
25def test_fraction_with_spaces(default_str_to_float):
26    assert 3 / 2 == default_str_to_float("3 / 2")