11import os
2+ import sys
23import unittest
34
45import pytest
@@ -102,7 +103,8 @@ def test_parse_arguemnts(options, reporter):
102103 verify_all ("Parse arguments from complex object" , results , reporter = reporter )
103104
104105
105- @unittest .skipIf (WINDOWS , reason = "ApprovalTest do not support different line feeds" )
106+ @pytest .mark .skipif (WINDOWS , reason = "ApprovalTest do not support different line feeds" )
107+ @pytest .mark .skipif (sys .version_info > (3 , 11 ), reason = "Errors change with Python 3.12" )
106108def test_parse_options_string_errors (options , reporter ):
107109 results = []
108110 results .append (error_formatter (options ._parse , 'method("arg1)' , True ))
@@ -114,6 +116,19 @@ def test_parse_options_string_errors(options, reporter):
114116 verify_all ("Selenium options string errors" , results , reporter = reporter )
115117
116118
119+ @pytest .mark .skipif (WINDOWS , reason = "ApprovalTest do not support different line feeds" )
120+ @pytest .mark .skipif (sys .version_info < (3 , 12 ), reason = "Errors change with Python 3.12" )
121+ def test_parse_options_string_errors_py3_12 (options , reporter ):
122+ results = []
123+ results .append (error_formatter (options ._parse , 'method("arg1)' , True ))
124+ results .append (error_formatter (options ._parse , 'method(arg1")' , True ))
125+ results .append (error_formatter (options ._parse , "method(arg1)" , True ))
126+ results .append (error_formatter (options ._parse , "attribute=arg1" , True ))
127+ results .append (error_formatter (options ._parse , "attribute=webdriver" , True ))
128+ results .append (error_formatter (options ._parse , 'method(argument="value")' , True ))
129+ verify_all ("Selenium options string errors" , results , reporter = reporter )
130+
131+
117132@unittest .skipIf (WINDOWS , reason = "ApprovalTest do not support different line feeds" )
118133def test_split_options (options , reporter ):
119134 results = []
@@ -203,8 +218,6 @@ def output_dir():
203218 output_dir = os .path .abspath (os .path .join (curr_dir , ".." , ".." , "output_dir" ))
204219 return output_dir
205220
206- from selenium .webdriver .chrome .service import Service as ChromeService
207-
208221
209222def test_create_chrome_with_options (creator ):
210223 options = mock ()
0 commit comments