Skip to content

Commit

Permalink
Merge #20 load all tests for coverage
Browse files Browse the repository at this point in the history
chore(tests) load all tests for coverage
  • Loading branch information
wilhelmagren authored Sep 10, 2023
2 parents 461c7b9 + b08f479 commit a4649ad
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,28 @@
File created: 2022-09-10
Last updated: 2023-09-10
"""

import inspect
import pkgutil
import unittest
import sys
import logging

log = logging.getLogger(__name__)

console_handler = logging.StreamHandler(sys.stdout)
console_handler.setLevel(logging.DEBUG)

formatter = logging.Formatter("[%(asctime)s] [%(name)s] [%(levelname)s\t] %(message)s")

console_handler.setFormatter(formatter)
log.addHandler(console_handler)


def load_tests(loader, suite, pattern):
for imp, modname, _ in pkgutil.walk_packages(__path__):
mod = imp.find_module(modname).load_module(modname)
for test in loader.loadTestsFromModule(mod):
suite.addTests(test)

return suite

0 comments on commit a4649ad

Please sign in to comment.