File: __init__.py

package info (click to toggle)
rpyc 6.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,324 kB
  • sloc: python: 6,442; makefile: 122
file content (17 lines) | stat: -rw-r--r-- 633 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import sys
import rpyc
from pathlib import Path

def load_tests(loader, standard_tests, pattern):
    # Hook rpyc logger, unittest verbosity, and system paths
    #rpyc.core.DEFAULT_CONFIG['logger'] = rpyc.lib.setup_logger()
    rpyc_tests_path = Path(__file__).absolute().parent
    rpyc_path = rpyc_tests_path.parent
    for p in [str(rpyc_path), str(rpyc_tests_path)]:
        if p not in sys.path:
            sys.path.insert(0, p)

    # Discover on tests and add paths
    tests = loader.discover(start_dir=rpyc_tests_path, pattern=pattern, top_level_dir=rpyc_path)
    standard_tests.addTests(tests)
    return standard_tests