1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
class singleton:
def __init__(self, name: str) -> None:
self.name = name
def __repr__(self) -> str:
return '<%s>' % self.name
__str__ = __repr__
not_there: singleton = singleton('not_there')
from testfixtures.comparison import (
Comparison, StringComparison, RoundComparison, compare, diff, RangeComparison,
SequenceComparison, Subset, Permutation, MappingComparison, like, sequence,
contains, unordered
)
from testfixtures.datetime import mock_datetime, mock_date, mock_time
from testfixtures.logcapture import LogCapture, log_capture
from testfixtures.outputcapture import OutputCapture
from testfixtures.resolve import resolve
from testfixtures.replace import (
Replacer,
Replace,
replace,
replace_in_environ,
replace_on_class,
replace_in_module,
)
from testfixtures.shouldraise import ShouldRaise, should_raise, ShouldAssert
from testfixtures.shouldwarn import ShouldWarn, ShouldNotWarn
from testfixtures.tempdirectory import TempDirectory, tempdir
from testfixtures.utils import wrap, generator
# backwards compatibility for the old names
test_datetime = mock_datetime
test_datetime.__test__ = False # type: ignore[attr-defined]
test_date = mock_date
test_date.__test__ = False # type: ignore[attr-defined]
test_time = mock_time
test_time.__test__ = False # type: ignore[attr-defined]
__all__ = [
'Comparison',
'LogCapture',
'MappingComparison',
'OutputCapture',
'Permutation',
'RangeComparison',
'Replace',
'Replacer',
'RoundComparison',
'SequenceComparison',
'ShouldAssert',
'ShouldRaise',
'ShouldNotWarn',
'ShouldWarn',
'Subset',
'StringComparison',
'TempDirectory',
'compare',
'contains',
'diff',
'generator',
'like',
'log_capture',
'mock_date',
'mock_datetime',
'mock_time',
'not_there',
'replace',
'replace_in_environ',
'replace_on_class',
'replace_in_module',
'resolve',
'sequence',
'should_raise',
'singleton',
'tempdir',
'test_date',
'test_datetime',
'test_time',
'unordered',
'wrap',
]
|