diff --git a/telegram/ext/conversationhandler.py b/telegram/ext/conversationhandler.py index 943d63ca0..3a4de95ac 100644 --- a/telegram/ext/conversationhandler.py +++ b/telegram/ext/conversationhandler.py @@ -243,7 +243,7 @@ class ConversationHandler(Handler): state = self.conversations.get(key) # Resolve promises - if isinstance(state, tuple) and len(state) is 2 and isinstance(state[1], Promise): + if isinstance(state, tuple) and len(state) == 2 and isinstance(state[1], Promise): self.logger.debug('waiting for promise...') old_state, new_state = state diff --git a/tests/test_animation.py b/tests/test_animation.py index ca95c15ab..fb0b77117 100644 --- a/tests/test_animation.py +++ b/tests/test_animation.py @@ -50,7 +50,7 @@ class TestAnimation(object): def test_creation(self, animation): assert isinstance(animation, Animation) assert isinstance(animation.file_id, str) - assert animation.file_id is not '' + assert animation.file_id != '' def test_expected_values(self, animation): assert animation.file_size == self.file_size diff --git a/tests/test_audio.py b/tests/test_audio.py index e5a0bb73c..a0e778650 100644 --- a/tests/test_audio.py +++ b/tests/test_audio.py @@ -56,7 +56,7 @@ class TestAudio(object): # Make sure file has been uploaded. assert isinstance(audio, Audio) assert isinstance(audio.file_id, str) - assert audio.file_id is not '' + assert audio.file_id != '' def test_expected_values(self, audio): assert audio.duration == self.duration diff --git a/tests/test_document.py b/tests/test_document.py index 406bfc971..f4d8cb60e 100644 --- a/tests/test_document.py +++ b/tests/test_document.py @@ -50,7 +50,7 @@ class TestDocument(object): def test_creation(self, document): assert isinstance(document, Document) assert isinstance(document.file_id, str) - assert document.file_id is not '' + assert document.file_id != '' def test_expected_values(self, document): assert document.file_size == self.file_size diff --git a/tests/test_inputmedia.py b/tests/test_inputmedia.py index c133f555c..4cad93fff 100644 --- a/tests/test_inputmedia.py +++ b/tests/test_inputmedia.py @@ -290,7 +290,7 @@ class TestInputMediaDocument(object): @pytest.fixture(scope='function') # noqa: F811 -def media_group(photo, thumb): +def media_group(photo, thumb): # noqa: F811 return [InputMediaPhoto(photo, caption='photo `1`', parse_mode='Markdown'), InputMediaPhoto(thumb, caption='photo 2', parse_mode='HTML')] diff --git a/tests/test_messagequeue.py b/tests/test_messagequeue.py index 97ed3bf39..0ed7831a8 100644 --- a/tests/test_messagequeue.py +++ b/tests/test_messagequeue.py @@ -54,7 +54,7 @@ class TestDelayQueue(object): dsp.stop() assert dsp.is_alive() is False - assert self.testtimes or self.N == 0 is True + assert self.testtimes or self.N == 0 passes, fails = [], [] delta = (self.time_limit_ms - self.margin_ms) / 1000 for start, stop in enumerate(range(self.burst_limit + 1, len(self.testtimes))): diff --git a/tests/test_photo.py b/tests/test_photo.py index 521d2cd8e..eb73b44b0 100644 --- a/tests/test_photo.py +++ b/tests/test_photo.py @@ -59,11 +59,11 @@ class TestPhoto(object): # Make sure file has been uploaded. assert isinstance(photo, PhotoSize) assert isinstance(photo.file_id, str) - assert photo.file_id is not '' + assert photo.file_id != '' assert isinstance(thumb, PhotoSize) assert isinstance(thumb.file_id, str) - assert thumb.file_id is not '' + assert thumb.file_id != '' def test_expected_values(self, photo, thumb): assert photo.width == self.width diff --git a/tests/test_video.py b/tests/test_video.py index d91434029..d235cf552 100644 --- a/tests/test_video.py +++ b/tests/test_video.py @@ -52,11 +52,11 @@ class TestVideo(object): # Make sure file has been uploaded. assert isinstance(video, Video) assert isinstance(video.file_id, str) - assert video.file_id is not '' + assert video.file_id != '' assert isinstance(video.thumb, PhotoSize) assert isinstance(video.thumb.file_id, str) - assert video.thumb.file_id is not '' + assert video.thumb.file_id != '' def test_expected_values(self, video): assert video.width == self.width diff --git a/tests/test_videonote.py b/tests/test_videonote.py index 2bc6dffb1..083edcc45 100644 --- a/tests/test_videonote.py +++ b/tests/test_videonote.py @@ -48,11 +48,11 @@ class TestVideoNote(object): # Make sure file has been uploaded. assert isinstance(video_note, VideoNote) assert isinstance(video_note.file_id, str) - assert video_note.file_id is not '' + assert video_note.file_id != '' assert isinstance(video_note.thumb, PhotoSize) assert isinstance(video_note.thumb.file_id, str) - assert video_note.thumb.file_id is not '' + assert video_note.thumb.file_id != '' def test_expected_values(self, video_note): assert video_note.length == self.length