1
1
import os
2
+ import sys
2
3
import unittest
3
4
4
5
import pytest
@@ -102,7 +103,8 @@ def test_parse_arguemnts(options, reporter):
102
103
verify_all ("Parse arguments from complex object" , results , reporter = reporter )
103
104
104
105
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" )
106
108
def test_parse_options_string_errors (options , reporter ):
107
109
results = []
108
110
results .append (error_formatter (options ._parse , 'method("arg1)' , True ))
@@ -114,6 +116,19 @@ def test_parse_options_string_errors(options, reporter):
114
116
verify_all ("Selenium options string errors" , results , reporter = reporter )
115
117
116
118
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
+
117
132
@unittest .skipIf (WINDOWS , reason = "ApprovalTest do not support different line feeds" )
118
133
def test_split_options (options , reporter ):
119
134
results = []
@@ -203,8 +218,6 @@ def output_dir():
203
218
output_dir = os .path .abspath (os .path .join (curr_dir , ".." , ".." , "output_dir" ))
204
219
return output_dir
205
220
206
- from selenium .webdriver .chrome .service import Service as ChromeService
207
-
208
221
209
222
def test_create_chrome_with_options (creator ):
210
223
options = mock ()
0 commit comments