Skip to content

Conversation

@harshil21
Copy link
Member

@harshil21 harshil21 commented Aug 31, 2023

Expands test_official by verifying that the type hints in our lib is same as TG API's.
Also changes type hint of user_id in bot methods from int | str to just int as specified by the API.

The change is breaking because PassportFile.file_date now accepts a datetime only, and its de_json now converts int -> datetime. No longer breaking.

Tests pass locally, seem to be failing here mysteriously

After review, before merge:

  • remove print statements

@harshil21 harshil21 added ⚙️ bot-api affected functionality: bot-api ⚙️ tests affected functionality: tests 📋 do-not-merge-yet work status: do-not-merge-yet labels Aug 31, 2023
@harshil21
Copy link
Member Author

suggestions for optimizations / a different approach welcome btw

Base automatically changed from api-6.8 to master September 3, 2023 11:43
@harshil21 harshil21 marked this pull request as ready for review September 4, 2023 12:54
@harshil21 harshil21 added the 📋 pending-review work status: pending-review label Sep 4, 2023
@harshil21 harshil21 added the 🛠 breaking change type: breaking label Sep 4, 2023
@harshil21 harshil21 changed the title Verify type hints for Bot method parameters Verify type hints for Bot method & class parameters Sep 4, 2023
Copy link
Member

@Bibo-Joshi Bibo-Joshi left a comment

Choose a reason for hiding this comment

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

Pfew, that is quite some code 🤯 I went through it once and left a bunch of comments, but I probably didn't get everything :D
I feel like as a follow-up of this PR, a refactoring of test_official into multiple modules is in order. I'll create an issue for that.

@harshil21 harshil21 removed the 📋 pending-review work status: pending-review label Sep 4, 2023
Also don't collect test_official on py < 3.10
@harshil21 harshil21 removed 🛠 breaking change type: breaking 📋 do-not-merge-yet work status: do-not-merge-yet labels Sep 6, 2023
Copy link
Member

@Bibo-Joshi Bibo-Joshi 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 updates :)

Copy link
Member

@Bibo-Joshi Bibo-Joshi 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 new updates :) I don't think I have any more comments left - great job with Harshil, I continue to be amazed by your patience with test optimization 👏

Does anyone else want to review?

Copy link
Member

@Poolitzer Poolitzer left a comment

Choose a reason for hiding this comment

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

I didnt catch an error, great job with the official extension!

Copy link
Member

@lemontree210 lemontree210 left a comment

Choose a reason for hiding this comment

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

I am NOT picking on function docstrings containing a third-person verb instead of imperative 😆

Very impressive indeed. I think that there could be some intersections in functionality with our admonition inserting tools, but that's just a thought.

@harshil21 harshil21 added the 📋 pending-merge work status: pending-merge label Sep 15, 2023
Copy link
Member

@lemontree210 lemontree210 left a comment

Choose a reason for hiding this comment

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

Thank you!

@Bibo-Joshi
Copy link
Member

Deepsource failure is unrelated. Merging once other tests pass

@Bibo-Joshi Bibo-Joshi merged commit 39abf83 into master Sep 15, 2023
@Bibo-Joshi Bibo-Joshi deleted the improve-test-official branch September 15, 2023 19:33
@Bibo-Joshi
Copy link
Member

Awesome addition! thanks a lot :)

@github-actions github-actions bot locked and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

⚙️ bot-api affected functionality: bot-api 📋 pending-merge work status: pending-merge ⚙️ tests affected functionality: tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants