915b2b604c
This automates the manual dance around version numbers for less maintenance pain. The main visible changes are: - requirements are in requirements.txt for now - tags must be just x.y.z not testtools-x.y.z - version information in __init__ is dynamically looked up. - we can probably cleanup a bunch of our bootstrap import glue but in the interest of clear reviews, and avoiding surprises, I'm leaving that alone for now. Change-Id: Ia54f681b50764a94ada68a6b2ac1bc77bfb619c5
128 lines
3.4 KiB
Python
128 lines
3.4 KiB
Python
# Copyright (c) 2008-2012 testtools developers. See LICENSE for details.
|
|
|
|
"""Extensions to the standard Python unittest library."""
|
|
|
|
__all__ = [
|
|
'clone_test_with_new_id',
|
|
'CopyStreamResult',
|
|
'ConcurrentTestSuite',
|
|
'ConcurrentStreamTestSuite',
|
|
'DecorateTestCaseResult',
|
|
'ErrorHolder',
|
|
'ExpectedException',
|
|
'ExtendedToOriginalDecorator',
|
|
'ExtendedToStreamDecorator',
|
|
'FixtureSuite',
|
|
'iterate_tests',
|
|
'MultipleExceptions',
|
|
'MultiTestResult',
|
|
'PlaceHolder',
|
|
'run_test_with',
|
|
'Tagger',
|
|
'TestCase',
|
|
'TestCommand',
|
|
'TestByTestResult',
|
|
'TestResult',
|
|
'TestResultDecorator',
|
|
'TextTestResult',
|
|
'RunTest',
|
|
'skip',
|
|
'skipIf',
|
|
'skipUnless',
|
|
'StreamFailFast',
|
|
'StreamResult',
|
|
'StreamResultRouter',
|
|
'StreamSummary',
|
|
'StreamTagger',
|
|
'StreamToDict',
|
|
'StreamToExtendedDecorator',
|
|
'StreamToQueue',
|
|
'TestControl',
|
|
'ThreadsafeForwardingResult',
|
|
'TimestampingStreamResult',
|
|
'try_import',
|
|
'try_imports',
|
|
]
|
|
|
|
# Compat - removal announced in 0.9.25.
|
|
try:
|
|
from extras import (
|
|
try_import,
|
|
try_imports,
|
|
)
|
|
except ImportError:
|
|
# Support reading __init__ for __version__ without extras, because pip does
|
|
# not support setup_requires.
|
|
pass
|
|
else:
|
|
|
|
from testtools.matchers._impl import (
|
|
Matcher,
|
|
)
|
|
# Shut up, pyflakes. We are importing for documentation, not for namespacing.
|
|
Matcher
|
|
|
|
from testtools.runtest import (
|
|
MultipleExceptions,
|
|
RunTest,
|
|
)
|
|
from testtools.testcase import (
|
|
DecorateTestCaseResult,
|
|
ErrorHolder,
|
|
ExpectedException,
|
|
PlaceHolder,
|
|
TestCase,
|
|
clone_test_with_new_id,
|
|
run_test_with,
|
|
skip,
|
|
skipIf,
|
|
skipUnless,
|
|
)
|
|
from testtools.testresult import (
|
|
CopyStreamResult,
|
|
ExtendedToOriginalDecorator,
|
|
ExtendedToStreamDecorator,
|
|
MultiTestResult,
|
|
StreamFailFast,
|
|
StreamResult,
|
|
StreamResultRouter,
|
|
StreamSummary,
|
|
StreamTagger,
|
|
StreamToDict,
|
|
StreamToExtendedDecorator,
|
|
StreamToQueue,
|
|
Tagger,
|
|
TestByTestResult,
|
|
TestControl,
|
|
TestResult,
|
|
TestResultDecorator,
|
|
TextTestResult,
|
|
ThreadsafeForwardingResult,
|
|
TimestampingStreamResult,
|
|
)
|
|
from testtools.testsuite import (
|
|
ConcurrentTestSuite,
|
|
ConcurrentStreamTestSuite,
|
|
FixtureSuite,
|
|
iterate_tests,
|
|
)
|
|
from testtools.distutilscmd import (
|
|
TestCommand,
|
|
)
|
|
|
|
# same format as sys.version_info: "A tuple containing the five components of
|
|
# the version number: major, minor, micro, releaselevel, and serial. All
|
|
# values except releaselevel are integers; the release level is 'alpha',
|
|
# 'beta', 'candidate', or 'final'. The version_info value corresponding to the
|
|
# Python version 2.0 is (2, 0, 0, 'final', 0)." Additionally we use a
|
|
# releaselevel of 'dev' for unreleased under-development code.
|
|
#
|
|
# If the releaselevel is 'alpha' then the major/minor/micro components are not
|
|
# established at this point, and setup.py will use a version of next-$(revno).
|
|
# If the releaselevel is 'final', then the tarball will be major.minor.micro.
|
|
# Otherwise it is major.minor.micro~$(revno).
|
|
from pbr.version import VersionInfo
|
|
_version = VersionInfo('testtools')
|
|
__version__ = _version.semantic_version().version_tuple()
|
|
version = _version.release_string()
|