Skip to content

Commit c335601

Browse files
living180matthiask
authored andcommitted
Avoid selenium deprecation warning when testing
Switch from setting the options.headless attribute to calling options.add_argument("-headless"). See [1] for more info. [1] https://www.selenium.dev/blog/2023/headless-is-going-away/
1 parent 857e329 commit c335601

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/test_integration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,8 @@ class DebugToolbarLiveTestCase(StaticLiveServerTestCase):
533533
def setUpClass(cls):
534534
super().setUpClass()
535535
options = Options()
536-
options.headless = bool(os.environ.get("CI"))
536+
if os.environ.get("CI"):
537+
options.add_argument("-headless")
537538
cls.selenium = webdriver.Firefox(options=options)
538539

539540
@classmethod

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ deps =
2323
Jinja2
2424
html5lib
2525
pygments
26-
selenium
26+
selenium>=4.8.0
2727
sqlparse
2828
passenv=
2929
CI

0 commit comments

Comments
 (0)