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: only test .py files #301

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions tests/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,18 @@
def find_modules_in_path(path):
modules = []

# Walk through the directory structure recursively
for root, _, files in os.walk(path):
# Iterate over each file in the current directory
for file in files:
# Construct the module name relative to the specified path
module_path = os.path.relpath(os.path.join(root, file), path)

# Convert path separators to dots to form the module name
module_name = os.path.splitext(module_path.replace(os.sep, "."))[0]

# Append the module name to the list
_module = "{}.{}".format(
path.replace("src/", "").replace("/", "."),
module_name.replace(".__init__", ""),
)
modules.append(_module)
if file.endswith(".py"):
module_path = os.path.relpath(os.path.join(root, file), path)

module_name = os.path.splitext(module_path.replace(os.sep, "."))[0]

_module = "{}.{}".format(
path.replace("src/", "").replace("/", "."),
module_name.replace(".__init__", ""),
)
modules.append(_module)

return modules

Expand Down