Skip to content
Snippets Groups Projects
Commit a2d53ccf authored by mads's avatar mads
Browse files

pytest runner

parent 22587cf9
No related branches found
No related tags found
No related merge requests found
'''
Created on 29/01/2016
@author: mmpe
'''
import pytest
import os
pytest.main(os.path.dirname(__file__) + "./../")
import glob
import unittest
import os
from os.path import dirname, relpath, abspath
def module_strings():
test_file_paths = []
test_file_paths = glob.glob('test_*.py')
#test_file_strings.extend(glob.glob('../wetb/**/test_*.py'))
#for root,_,_ in os.walk("../wetb/"):
for folder, _, _ in os.walk(os.path.abspath(dirname(__file__) + '../wetb/')):
test_file_paths.extend(glob.glob(folder + "/tests/test_*.py"))
return [relpath(s, abspath(dirname(__file__) + "/../")).replace(".py", "").replace(os.path.sep, ".") for s in test_file_paths]
for folder, _, _ in os.walk('../wetb'):
test_file_paths.extend(glob.glob(os.path.join(folder, "tests/test_*.py")))
return [s[3:len(s) - 3].replace(os.path.sep, ".") for s in test_file_paths]
def suite():
modules = module_strings()
suites = []
try:
for s in modules:
suites = []
for s in module_strings():
suites.append(unittest.defaultTestLoader.loadTestsFromName(s))
except:
print ("Failed to import '%s'" % s)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment