mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-22 15:17:00 +01:00
Fix flake8 errors that only show in CI??
This commit is contained in:
parent
9817310788
commit
e08afe7fb2
9 changed files with 12 additions and 12 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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='<b>photo</b> 2', parse_mode='HTML')]
|
||||
|
||||
|
|
|
@ -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))):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue