From c3c75c12d956071650ba7f6ce45cf383e41572d7 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 18 Oct 2019 09:03:31 +0200 Subject: [PATCH] Use ==/!= to compare str, bytes, and int literals Python 3.8 will probably [raise SyntaxWarnings](https://docs.python.org/3/whatsnew/3.8.html#changes-in-python-behavior) on the flake8 F632 issue raised below. [flake8](http://flake8.pycqa.org) testing of https://github.com/spulec/moto on Python 3.7.1 $ __flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics__ ``` ./tests/test_awslambda/test_lambda.py:1137:24: F632 use ==/!= to compare str, bytes, and int literals assert len(messages) is 3 ^ 1 F632 use ==/!= to compare str, bytes, and int literals 1 ``` --- tests/test_awslambda/test_lambda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_awslambda/test_lambda.py b/tests/test_awslambda/test_lambda.py index 2f47b6284..d57722074 100644 --- a/tests/test_awslambda/test_lambda.py +++ b/tests/test_awslambda/test_lambda.py @@ -1134,7 +1134,7 @@ def test_invoke_function_from_sqs_exception(): if 'I failed!' in event['message']: messages = queue.receive_messages(MaxNumberOfMessages=10) # Verify messages are still visible and unprocessed - assert len(messages) is 3 + assert len(messages) == 3 return time.sleep(1)