mirror of https://github.com/patacrep/patacrep.git
Engine for LaTeX songbooks
http://www.patacrep.com
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
702 B
31 lines
702 B
10 years ago
|
"""Tests"""
|
||
|
|
||
9 years ago
|
import contextlib
|
||
10 years ago
|
import doctest
|
||
9 years ago
|
import logging
|
||
10 years ago
|
import os
|
||
|
import unittest
|
||
|
|
||
|
import patacrep
|
||
|
|
||
9 years ago
|
@contextlib.contextmanager
|
||
|
def disable_logging():
|
||
|
"""Context locally disabling logging."""
|
||
|
logging.disable(logging.CRITICAL)
|
||
|
yield
|
||
|
logging.disable(logging.NOTSET)
|
||
|
|
||
10 years ago
|
def suite():
|
||
9 years ago
|
"""Return a :class:`TestSuite` object, testing all module :mod:`patacrep`.
|
||
10 years ago
|
"""
|
||
|
test_loader = unittest.defaultTestLoader
|
||
9 years ago
|
return test_loader.discover(
|
||
|
os.path.abspath(os.path.dirname(__file__)),
|
||
|
pattern="*.py",
|
||
|
top_level_dir=os.path.abspath(os.path.join(patacrep.__path__[0], "..")),
|
||
|
)
|
||
10 years ago
|
|
||
|
if __name__ == "__main__":
|
||
|
unittest.TextTestRunner().run(suite())
|
||
9 years ago
|
|