55
66from nose .plugins import Plugin
77from pyvirtualdisplay import Display
8+ from seleniumbase .core import proxy_helper
89from seleniumbase .fixtures import constants
910
1011
@@ -62,6 +63,7 @@ def options(self, parser, env):
6263 default = None ,
6364 help = """Designates the proxy server:port to use.
6465 Format: servername:port. OR
66+ username:password@servername:port OR
6567 A dict key from proxy_list.PROXY_LIST
6668 Default: None.""" )
6769 parser .add_option (
@@ -116,6 +118,7 @@ def configure(self, options, conf):
116118 self .enabled = True # Used if test class inherits BaseCase
117119 self .options = options
118120 self .headless_active = False # Default setting
121+ proxy_helper .remove_proxy_zip_if_present ()
119122
120123 def beforeTest (self , test ):
121124 test .test .browser = self .options .browser
@@ -142,6 +145,10 @@ def beforeTest(self, test):
142145 self .driver = None
143146 test .test .driver = self .driver
144147
148+ def finalize (self , result ):
149+ """ This runs after all tests have completed with nosetests. """
150+ proxy_helper .remove_proxy_zip_if_present ()
151+
145152 def afterTest (self , test ):
146153 try :
147154 # If the browser window is still open, close it now.
0 commit comments