2019-11-06 02:25:23 +00:00
|
|
|
#!/usr/bin/env python3
|
2018-12-28 02:27:56 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2021-01-01 17:14:24 +00:00
|
|
|
# Copyright 2009-2021 Joshua Bronson. All Rights Reserved.
|
2018-12-28 02:27:56 +00:00
|
|
|
#
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
# First run all tests that pytest discovers.
|
|
|
|
|
|
|
|
"""Run all tests."""
|
|
|
|
|
2019-10-26 15:03:04 +00:00
|
|
|
import sys
|
2018-12-28 02:27:56 +00:00
|
|
|
from functools import reduce
|
|
|
|
from operator import or_
|
2019-10-26 15:03:04 +00:00
|
|
|
|
2018-12-28 02:27:56 +00:00
|
|
|
from pytest import main as pytest_main
|
|
|
|
from sphinx.cmd.build import main as sphinx_main
|
|
|
|
|
|
|
|
|
|
|
|
TEST_FUNCS = [
|
|
|
|
pytest_main,
|
|
|
|
|
|
|
|
# pytest's doctest support doesn't support Sphinx extensions
|
|
|
|
# (see https://www.sphinx-doc.org/en/latest/usage/extensions/doctest.html)
|
|
|
|
# so †est the code in the Sphinx docs using Sphinx's own doctest support.
|
|
|
|
lambda: sphinx_main('-b doctest -d docs/_build/doctrees docs docs/_build/doctest'.split()),
|
|
|
|
]
|
|
|
|
|
2019-10-26 15:03:04 +00:00
|
|
|
sys.exit(reduce(or_, (f() for f in TEST_FUNCS)))
|