Skip to content

Commit

Permalink
debug: submodule search
Browse files Browse the repository at this point in the history
  • Loading branch information
toruseo committed Mar 25, 2024
1 parent 7b492ae commit ded5632
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/test-search.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test GUI

on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 6 * * 1'

jobs:
test-gui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install uxsim and dependencies
run: pip install .
- name: Install pytest other dependencies
run: pip install pytest setuptools
- name: Run test with pytest
run: pytest tests/test_submodule_search.py --durations=0 -v -s
13 changes: 13 additions & 0 deletions tests/test_submodule_search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import pkgutil
import importlib

def print_submodules(package_name):
package = importlib.import_module(package_name)
print(f"Submodules in {package_name}:")
for importer, modname, ispkg in pkgutil.walk_packages(package.__path__, prefix=package.__name__+'.'):
print(modname)

# 例: 'your_package_name' を探索したいパッケージの名前に置き換えてください
def test_search:
print_submodules('uxsim')

0 comments on commit ded5632

Please sign in to comment.