diff --git a/robobrowser/browser.py b/robobrowser/browser.py index 32e9338..96a2324 100644 --- a/robobrowser/browser.py +++ b/robobrowser/browser.py @@ -67,7 +67,7 @@ class RoboBrowser(object): def __init__(self, session=None, parser=None, user_agent=None, history=True, timeout=None, allow_redirects=True, cache=False, cache_patterns=None, max_age=None, max_count=None, tries=None, - multiplier=None): + multiplier=0): self.session = session or requests.Session() diff --git a/tests/test_browser.py b/tests/test_browser.py index 45731ca..b17a305 100644 --- a/tests/test_browser.py +++ b/tests/test_browser.py @@ -343,3 +343,12 @@ def test_call_allow_redirects(self, mock_request): assert_true(mock_request.called) kwargs = mock_request.mock_calls[0][2] assert_true(kwargs.get('allow_redirects') is False) + + +class TestRetry(unittest.TestCase): + + def test_default_backoff_factor_not_none(self): + session = RoboBrowser(tries=3).session + for protocol in session.adapters: + factor = session.adapters[protocol].max_retries.backoff_factor + assert_true(factor is not None)