Skip to content

Commit

Permalink
Fix windows actions (python-telegram-bot#1605)
Browse files Browse the repository at this point in the history
* Stop testing with ujson

* Fix timing issue with test_delete_message

* ignore pip deprecation warning. hopefully it will fix windows+py2.7

* telegram replies to deleteing old messages are not consistent
  • Loading branch information
tsnoam committed Nov 9, 2019
1 parent 8b4b22c commit e9d9f01
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U codecov pytest-cov
pip install ujson
pip install -r requirements.txt
pip install -r requirements-dev.txt
python -W ignore -m pip install --upgrade pip
python -W ignore -m pip install -U codecov pytest-cov
python -W ignore -m pip install -r requirements.txt
python -W ignore -m pip install -r requirements-dev.txt
- name: Test with pytest
run: |
Expand Down
3 changes: 2 additions & 1 deletion tests/test_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,14 @@ def test_forward_message(self, bot, chat_id, message):
@pytest.mark.timeout(10)
def test_delete_message(self, bot, chat_id):
message = bot.send_message(chat_id, text='will be deleted')
time.sleep(2)

assert bot.delete_message(chat_id=chat_id, message_id=message.message_id) is True

@flaky(3, 1)
@pytest.mark.timeout(10)
def test_delete_message_old_message(self, bot, chat_id):
with pytest.raises(TelegramError, match='Message to delete not found'):
with pytest.raises(BadRequest):
# Considering that the first message is old enough
bot.delete_message(chat_id=chat_id, message_id=1)

Expand Down

0 comments on commit e9d9f01

Please sign in to comment.