Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix Failing Tests by Making Them Independent #4494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions tests/test_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2863,10 +2863,13 @@ async def test_edit_message_text_entities(self, bot, message):
assert message.entities == tuple(entities)

@pytest.mark.parametrize("default_bot", [{"parse_mode": "Markdown"}], indirect=True)
async def test_edit_message_text_default_parse_mode(self, default_bot, message):
async def test_edit_message_text_default_parse_mode(self, default_bot, chat_id):
test_string = "Italic Bold Code"
test_markdown_string = "_Italic_ *Bold* `Code`"

# can't use `message` fixture as that would change its value
message = await default_bot.send_message(chat_id, "dummy text")

message = await default_bot.edit_message_text(
text=test_markdown_string,
chat_id=message.chat_id,
Expand Down Expand Up @@ -2937,10 +2940,16 @@ async def test_edit_message_caption_entities(self, bot, media_message):
# edit_message_media is tested in test_inputmedia

@pytest.mark.parametrize("default_bot", [{"parse_mode": "Markdown"}], indirect=True)
async def test_edit_message_caption_default_parse_mode(self, default_bot, media_message):
async def test_edit_message_caption_default_parse_mode(self, default_bot, chat_id):
test_string = "Italic Bold Code"
test_markdown_string = "_Italic_ *Bold* `Code`"

# can't use `media_message` fixture as that would change its value
with data_file("telegram.ogg").open("rb") as f:
media_message = await default_bot.send_voice(
chat_id, voice=f, caption="my caption", read_timeout=10
)

message = await default_bot.edit_message_caption(
caption=test_markdown_string,
chat_id=media_message.chat_id,
Expand Down
Loading