def test_parser_private_warns(): from dateutil.parser import _timelex, _tzparser from dateutil.parser import _parsetz with pytest.warns(DeprecationWarning): _tzparser() with pytest.warns(DeprecationWarning): _timelex('2014-03-03') with pytest.warns(DeprecationWarning): _parsetz('+05:00')
def test_parser_parser_private_not_warns(): from dateutil.parser._parser import _timelex, _tzparser from dateutil.parser._parser import _parsetz with warnings.catch_warnings(): warnings.simplefilter("error") _tzparser() with warnings.catch_warnings(): warnings.simplefilter("error") _timelex('2014-03-03') with warnings.catch_warnings(): warnings.simplefilter("error") _parsetz('+05:00')
def test_parser_parser_private_not_warns(): from dateutil.parser._parser import _timelex, _tzparser from dateutil.parser._parser import _parsetz with pytest.warns(None) as recorder: _tzparser() assert len(recorder) == 0 with pytest.warns(None) as recorder: _timelex('2014-03-03') assert len(recorder) == 0 with pytest.warns(None) as recorder: _parsetz('+05:00') assert len(recorder) == 0