Skip to content

Commit

Permalink
Merge 5cd28b6 into 293118a
Browse files Browse the repository at this point in the history
  • Loading branch information
jugmac00 committed Mar 27, 2021
2 parents 293118a + 5cd28b6 commit e0fdbd0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Changelog
- Google Chrome: Add temporary download directory support. It is
accessible as a ``pathlib.Path`` via ``self.layer['selenium_download_dir']``.

- Improve formatting of warnings when environment variables are not set to a
valid value.


6.0 (2020-12-16)
----------------
Expand Down
12 changes: 6 additions & 6 deletions src/gocept/selenium/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ def setUp(self):
headless = os.environ.get('GOCEPT_SELENIUM_HEADLESS')

if headless is None or headless.lower() not in ['true', 'false']:
warnings.warn('GOCEPT_SELENIUM_HEADLESS invalid. \
Possible values are true and false. Got: %s.\
Falling back to default (false).' %
warnings.warn('GOCEPT_SELENIUM_HEADLESS invalid.'
' Possible values are true and false. Got: %s.'
' Falling back to default (false).' %
os.environ.get('GOCEPT_SELENIUM_HEADLESS'))
headless = 'false'

if headless.lower() == 'true':
self.headless = True

if browser is None or browser.lower() not in ['chrome', 'firefox']:
warnings.warn('GOCEPT_WEBDRIVER_BROWSER invalid. \
Possible values are firefox and chrome. Got: %s.\
Falling back to firefox.' %
warnings.warn('GOCEPT_WEBDRIVER_BROWSER invalid.'
' Possible values are firefox and chrome. Got: %s.'
' Falling back to firefox.' %
os.environ.get('GOCEPT_WEBDRIVER_BROWSER'))
browser = 'firefox'

Expand Down

0 comments on commit e0fdbd0

Please sign in to comment.