MDAF/tests/test_funcs.py
Remi Ehounou 3ce33b3a50 MDAF-V1
2021-09-11 00:46:56 -04:00

22 lines
667 B
Python

import unittest
import os
import importlib.util as utl
from MDAF.TestFunctions import *
import doctest
# Testing the test function representation workflow
def load_tests(loader, tests, ignore):
fullpath = 'MDAF/TestFunctions'
for func in os.scandir(fullpath):
name = str(func.name)
if(name.find('.py') and name.find('.old') == -1 and func.is_file() and name.find('__init__.py')==-1):
spec = utl.spec_from_file_location(name[-3], fullpath+'/'+name)
funcmodule = utl.module_from_spec(spec)
spec.loader.exec_module(funcmodule)
tests.addTests(doctest.DocTestSuite(funcmodule))
return tests