Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Updated 3 failing tests of test_message.py.#4431

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

Palaptin
Copy link
Contributor

The tests test_link_with_topics and test_link_with_reply were failing if beeing runned alone ( since message.chat.type was private).

The test test_build_reply_arguments_chat_id_and_message_id was failing randomly, mostly when using pytest --lf (about 1 in 10 times). The reason was message.chat.username being set to 'username', so setting it to None will solve this problem.

The tests test_link_with_topics and test_link_with_reply were failing if beeing runned alone ( since message.chat.type was private).The test test_build_reply_arguments_chat_id_and_message_id was failing randomly, mostly when using pytest --lf (about 1 in 10 times). The reason was message.chat.username being set to 'username', so setting it to None will solve this problem.
Copy link
Member

@harshil21harshil21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for the fix! I noticed this myself a couple of times before but didn't investigate the cause.

To elaborate further after investigation - part of the reason why it doesn't fail when the whole test file is run is because themessage fixture is module scoped, and other tests are modifying that value (bad practice imo) which leads to a slightly different state for the next test. They fail individually because we initialize themessage fixture with a private chat anyway, which doesn't have public links obviously.

I would suggest changing the scope of that fixture back to "function" (the default) to reduce the chance of this occuring in the future.

@harshil21harshil21 added the ⚙️ testsaffected functionality: tests labelAug 16, 2024
… value 'function'Removed setting of message.chat.username to None in test 'test_build_reply_arguments_chat_id_and_message_id' since it is no longer needed.executed multiple times 'pytest -m no_req -n auto --dist=loadgroup --lf' to validate all tests in test_message.py will still pass.
Copy link
Member

@harshil21harshil21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

lgtm. Ran it locally on my end and it passes.

Palaptin reacted with thumbs up emoji
@Bibo-JoshiBibo-Joshi merged commitfbf07bf intopython-telegram-bot:masterAug 19, 2024
2 checks passed
@Bibo-Joshi
Copy link
Member

Thank you for the contribution!

@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 27, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@harshil21harshil21harshil21 approved these changes

Assignees
No one assigned
Labels
⚙️ testsaffected functionality: tests
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@Palaptin@Bibo-Joshi@harshil21

[8]ページ先頭

©2009-2025 Movatter.jp