Skip to content
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

[refactor] Remove variable for thing that never change in test_inference #2243

Conversation

Pierre-Sassoulas
Copy link
Member

Type of Changes

Type
βœ“ πŸ”¨ Refactoring

Description

Small thing that annoy me: Having to go check a constant 5000 lines above the test I'm looking at and the constant will never ever change.

@Pierre-Sassoulas Pierre-Sassoulas added the Maintenance Discussion or action around maintaining astroid or the dev workflow label Jul 8, 2023
@codecov
Copy link

codecov bot commented Jul 8, 2023

Codecov Report

Merging #2243 (3334919) into main (e91a3b5) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2243   +/-   ##
=======================================
  Coverage   92.77%   92.77%           
=======================================
  Files          94       94           
  Lines       10941    10941           
=======================================
  Hits        10151    10151           
  Misses        790      790           
Flag Coverage Ξ”
linux 92.58% <ΓΈ> (ΓΈ)
pypy 90.89% <ΓΈ> (ΓΈ)
windows 92.34% <ΓΈ> (ΓΈ)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

Copy link
Member

@jacobtylerwalls jacobtylerwalls left a comment

Choose a reason for hiding this comment

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

I like getting rid of BOOL_SPECIAL_METHOD because I think __bool__ reads much better but am -0 on the other change. I generally like extracting a constant from a string that has to be used repeatedly, as it guards against typos.

@Pierre-Sassoulas
Copy link
Member Author

Wouldn't the test fail and show a diff of the two strings in case of typo ?

@jacobtylerwalls
Copy link
Member

Good point, I forgot these are unit tests.

Having to go check a constant 5000 lines above

You gotta use mouse hovering! :D

@Pierre-Sassoulas Pierre-Sassoulas merged commit 4d77ff6 into main Jul 8, 2023
19 checks passed
@Pierre-Sassoulas Pierre-Sassoulas deleted the remove-variable-that-complicate-things-needlessly-in-test-inference branch July 8, 2023 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining astroid or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants