Skip to content

Commit

Permalink
pygrass: Use logging warnings to track ModulesMeta hangs in modules/i…
Browse files Browse the repository at this point in the history
…nterface tests
  • Loading branch information
echoix committed Nov 24, 2024
1 parent f590288 commit 9a5e8f3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
@author: pietro
"""

# ruff: noqa: LOG015
from fnmatch import fnmatch
from logging import warning

from grass.gunittest.case import TestCase
from grass.gunittest.main import test
Expand All @@ -20,6 +22,7 @@

class ModulesMeta(type):
def __new__(cls, name, bases, dict):
warning("In __new__ of ModulesMeta")
print("In __new__ of ModulesMeta")

def gen_test(cmd):
Expand All @@ -35,6 +38,7 @@ def test(self):
]
for cmd in cmds:
test_name = "test__%s" % cmd.replace(".", "_")
warning("cmd is: %s, test_name: %s", cmd, test_name)
print(f"cmd is: {cmd}, test_name: {test_name}")
dict[test_name] = gen_test(cmd)
return type.__new__(cls, name, bases, dict)
Expand All @@ -45,4 +49,5 @@ class TestModules(TestCase, metaclass=ModulesMeta):


if __name__ == "__main__":
warning("Starting test of %s", __file__)
test()

0 comments on commit 9a5e8f3

Please sign in to comment.