Example #1
0
def _construct_subunit(**kwargs):
    from subunit import StreamResultToBytes
    stream = kwargs.pop('stream')
    failfast = kwargs.pop('failfast')
    _raise_on_unknown_kwargs(kwargs)
    result_object = LoggedTestResultDecorator(
        ExtendedToStreamDecorator(StreamResultToBytes(stream)))
    result_object.failfast = failfast
    return result_object
Example #2
0
def _construct_xml(**kwargs):
    from junitxml import JUnitXmlResult
    stream = kwargs.pop('stream')
    failfast = kwargs.pop('failfast')
    _raise_on_unknown_kwargs(kwargs)
    result_object = LoggedTestResultDecorator(
        ExtendedToOriginalDecorator(JUnitXmlResult(stream)))
    result_object.failfast = failfast
    return result_object
Example #3
0
 def test_raise_if_not_empty_does_not_raise_on_empty(self):
     empty_dict = dict()
     self.assertThat(lambda: _raise_on_unknown_kwargs(empty_dict),
                     Not(Raises()))
Example #4
0
 def test_raise_if_not_empty_raises_on_nonempty_dict(self):
     populated_dict = dict(testing=True)
     self.assertThat(
         lambda: _raise_on_unknown_kwargs(populated_dict),
         raises(ValueError("Unknown keyword arguments: 'testing'.")))
Example #5
0
def _construct_text(**kwargs):
    stream = kwargs.pop('stream')
    failfast = kwargs.pop('failfast')
    _raise_on_unknown_kwargs(kwargs)
    return LoggedTestResultDecorator(TextTestResult(stream, failfast))