-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
Generalize namespace static analysis tests #756
Conversation
This switches to a single parametrized test that covers all of Trio's public namespaces, and if it fails, then it prints a nice readable list of the missing symbols. Also adds the symbols that were missing from trio.socket's static import list on my laptop, and adds some comments to trio.socket while I'm at it.
Codecov Report
@@ Coverage Diff @@
## master #756 +/- ##
==========================================
- Coverage 99.34% 99.32% -0.02%
==========================================
Files 96 96
Lines 11586 11597 +11
Branches 827 831 +4
==========================================
+ Hits 11510 11519 +9
- Misses 56 57 +1
- Partials 20 21 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! (And works on macOS 10.14.)
for (_name, _value) in _stdlib_socket.__dict__.items() | ||
if _name.isupper() and not _name.startswith('_') | ||
_name: getattr(_stdlib_socket, _name) | ||
for _name in _stdlib_socket.__all__ if _name.isupper() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to change this again?
if not value.__name__.startswith(module.__name__): | ||
continue | ||
if value is module: | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This line does not seem to be covered by the tests.)
This switches to a single parametrized test that covers all of Trio's
public namespaces, and if it fails, then it prints a nice readable
list of the missing symbols.
Also adds the symbols that were missing from trio.socket's static
import list on my laptop, and adds some comments to trio.socket while
I'm at it.
CC: @jmfrank63 @Zac-HD