sphinxext-ip/tests/run.py
Jan Dittberner 585085250e Fix compatibility with Sphinx 2.1
- Fix deprecation warnings
- Fix missing API in tests
- Fix relative imports in tests
- use proper logger
2019-07-13 21:52:52 +02:00

42 lines
994 B
Python
Executable file

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
jandd.sphinxext.ip unit test driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This script runs the jandd.sphinxext.ip unit test suite.
:copyright: Copyright 2016 Jan Dittberner
:license: GPLv3+, see COPYING for details.
"""
import sys
from os import path
import unittest
def run(extra_args=[]):
sys.path.insert(0, path.join(path.dirname(__file__), path.pardir))
sys.path.insert(1, path.abspath(
path.join(path.dirname(__file__), path.pardir,
'jandd', 'sphinxext', 'ip'
))
)
try:
import sphinx
except ImportError:
print("The sphinx package is needed to run the jandd.sphinxext.ip "
"test suite.")
from .test_ip import TestIPExtension
print("Running jandd.sphinxext.ip test suite ...")
suite = unittest.TestLoader().loadTestsFromTestCase(TestIPExtension)
unittest.TextTestRunner(verbosity=2).run(suite)
if __name__ == '__main__':
run()