def test_failure_for_unspecified_module(self, mocked__testmod, mocked__stdout): with patch.dict(sys.modules, {'__main__': self.module}): failures, tests = run_module_doctests(bar='spam') mocked__testmod.assert_called_once_with(None, bar='spam') self._do_assertions_for_failure(mocked__stdout, failures, tests)
*** A full date is valid only in this order: a year, month, and day. >>> parse_iso_date_to_datetime('25-11-2020') # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... ValueError: *** A date has to be provided correctly. >>> parse_iso_date_to_datetime('2020-6-01') # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... ValueError: could not parse ... as ISO date *** A date that is out of range will also raise an exception (ValueError). >>> parse_iso_date_to_datetime('2020-12-33') # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... ValueError:... """ return date_to_datetime(parse_iso_date(s, prestrip=prestrip)) if __name__ == '__main__': run_module_doctests()
def test_failure_for_specified_module(self, mocked__testmod, mocked__stdout): failures, tests = run_module_doctests(self.module, 'foo', bar='spam') mocked__testmod.assert_called_once_with(self.module, 'foo', bar='spam') self._do_assertions_for_failure(mocked__stdout, failures, tests)