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

Test that package modules are accessible as symbols #404

Open
spbnick opened this issue Mar 21, 2023 · 2 comments
Open

Test that package modules are accessible as symbols #404

spbnick opened this issue Mar 21, 2023 · 2 comments
Assignees
Labels
good second issue Good for newcomers who're ready to try something harder

Comments

@spbnick
Copy link
Collaborator

spbnick commented Mar 21, 2023

We'd like to be able to access the package modules as symbols after importing the package's module (__init__.py).

I.e. given the kcidb package contains the db module, this should work:

import kcidb
print(kcidb.db)

Most of the code is already built that way. However, we don't have any tests verifying that.

Add a test to test_kcidb.py which starts with the kcidb package, lists modules under it (e.g. using pkgutil, like in kcidb.monitor.subscriptions), imports the package and verifies that each listed module is available as a symbol with type <class 'module'> inside it, then continues to all sub-packages recursively, until everything is verified.

@spbnick spbnick added the good second issue Good for newcomers who're ready to try something harder label Mar 21, 2023
@octonawish-akcodes
Copy link
Contributor

octonawish-akcodes commented Mar 22, 2023

can I have a try at it :)

@spbnick
Copy link
Collaborator Author

spbnick commented Mar 22, 2023

Sure! This could be fun 😁 Let's finish with the currently-open PRs first, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good second issue Good for newcomers who're ready to try something harder
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants