assert is not a function in Python and parentheses can create assert statements that are always True.
% python3.10
>>> assert True is False, "Did you know that True is False?"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AssertionError: Did you know that True is False?
>>> assert (True is False, "Did you know that True is False?")
<stdin>:1: SyntaxWarning: assertion is always true, perhaps remove parentheses?
./lux/tests/test_action.py:60:9: F631 assertion is always true, perhaps remove parentheses?
assert ("Temporal" in df.recommendation, "Temporal visualizations should be generated.")
^
./lux/tests/test_action.py:62:9: F631 assertion is always true, perhaps remove parentheses?
assert (len(recommended) == num_vis, "Incorrect number of temporal visualizations generated.")
^
./lux/tests/test_config.py:72:5: F631 assertion is always true, perhaps remove parentheses?
assert (
^
./lux/tests/test_config.py:83:5: F631 assertion is always true, perhaps remove parentheses?
assert (
^
./lux/tests/test_config.py:126:5: F631 assertion is always true, perhaps remove parentheses?
assert (
^
./lux/tests/test_config.py:130:5: F631 assertion is always true, perhaps remove parentheses?
assert (
^
./lux/tests/test_config.py:136:5: F631 assertion is always true, perhaps remove parentheses?
assert (
^
./lux/tests/test_config.py:170:5: F631 assertion is always true, perhaps remove parentheses?
assert (
^
./lux/tests/test_config.py:178:5: F631 assertion is always true, perhaps remove parentheses?
assert (
^
9 F631 assertion is always true, perhaps remove parentheses?
9
Changes
Describe the changes that your code introduces to Lux. Have you made corresponding tests and added the appropriate documentation for your changes? Do the commits pass the tests and follow the guidelines described here?
Example Output
Describe the expected behavior of your changes. If applicable, please include a screenshot.
Overview
assert
is not a function in Python and parentheses can createassert
statements that are always True.%
python3.10
%
flake8 . --count --select=E9,F63,F7,F82,Y --show-source --statistics
Changes
Describe the changes that your code introduces to Lux. Have you made corresponding tests and added the appropriate documentation for your changes? Do the commits pass the tests and follow the guidelines described here?
Example Output
Describe the expected behavior of your changes. If applicable, please include a screenshot.