You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
763 B
33 lines
763 B
# -*- coding: utf-8 -*-
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License version 2 as
|
|
# published by the Free Software Foundation.
|
|
|
|
import os
|
|
import sys
|
|
import functools
|
|
|
|
__directory__ = os.path.dirname(__file__)
|
|
|
|
|
|
@functools.lru_cache(maxsize=None)
|
|
def tests(name):
|
|
try:
|
|
module = __import__(name, globals(), None, (), 1)
|
|
return module.__tests__
|
|
except Exception as exc:
|
|
print(exc)
|
|
return ()
|
|
|
|
|
|
def all():
|
|
ignore = ("__init__.py", "__pycache__")
|
|
for filename in os.listdir(__directory__):
|
|
if filename not in ignore:
|
|
yield from tests(filename[:-3])
|
|
|
|
|
|
def category(category):
|
|
return tests(category.replace(".", ""))
|