mirror of
https://github.com/ejeanboris/MDAF.git
synced 2025-12-15 04:58:13 +00:00
MDAF-V1
This commit is contained in:
21
tests/test_funcs.py
Normal file
21
tests/test_funcs.py
Normal file
@@ -0,0 +1,21 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user