2828
2929
3030def diagnose () -> None :
31- logistro .getLogger ().setLevel (6 )
32- logistro .getLogger ().error ("Test" )
31+ logistro .betterConfig (level = 1 )
3332 from choreographer import Browser , BrowserSync
34- from choreographer .browsers .chromium import _find_a_chromium_based_browser
33+ from choreographer .browsers .chromium import Chromium
3534 from choreographer .utils ._which import browser_which
3635
3736 parser = argparse .ArgumentParser (
@@ -52,42 +51,52 @@ def diagnose() -> None:
5251 print (platform .release ())
5352 print (platform .version ())
5453 print (platform .uname ())
54+ print ("*" .center (50 , "*" ))
5555 print ("BROWSER:" .center (50 , "*" ))
5656 try :
57- print ("Found local: {browser_which(verify_local=True)}" )
57+ print (f "Found local: { browser_which ([], verify_local = True )} " )
5858 except RuntimeError :
5959 print ("Didn't find local." )
60- browser_path = _find_a_chromium_based_browser (skip_local = True )
60+ browser_path = Chromium . find_browser (skip_local = True )
6161 print (browser_path )
62+ print ("*" .center (50 , "*" ))
6263 print ("BROWSER_INIT_CHECK (DEPS)" .center (50 , "*" ))
6364 if not browser_path :
6465 print ("No browser, found can't check for deps." )
6566 else :
6667 b = Browser ()
6768 b ._browser_impl .pre_open ()
6869 cli = b ._browser_impl .get_cli ()
69- env = b ._browser_impl .get_env ()
70+ env = b ._browser_impl .get_env () # noqa: F841
71+ args = b ._browser_impl .get_popen_args ()
7072 b ._browser_impl .clean ()
7173 del b
72- print ("cli:" )
74+ print ("*** cli:" )
7375 for arg in cli :
74- print (arg )
75- print ("env:" )
76- for k , v in env .items ():
77- print (f"{ k } :{ v } " )
76+ print (" " * 8 + str (arg ))
77+
78+ # potential security issue
79+ # print("*** env:")
80+ # for k, v in env.items():
81+ # print(" " * 8 + f"{k}:{v}")
82+
83+ print ("*** Popen args:" )
84+ for k , v in args .items ():
85+ print (" " * 8 + f"{ k } :{ v } " )
86+ print ("*" .center (50 , "*" ))
7887 print ("VERSION INFO:" .center (50 , "*" ))
7988 try :
80- print ("PIP :" .center (25 , "*" ))
89+ print ("pip :" .center (25 , "*" ))
8190 print (subprocess .check_output ([sys .executable , "-m" , "pip" , "freeze" ]).decode ())
8291 except Exception as e :
8392 print (f"Error w/ pip: { e } " )
8493 try :
85- print ("UV :" .center (25 , "*" ))
94+ print ("uv :" .center (25 , "*" ))
8695 print (subprocess .check_output (["uv" , "pip" , "freeze" ]).decode ())
8796 except Exception as e :
8897 print (f"Error w/ uv: { e } " )
8998 try :
90- print ("GIT :" .center (25 , "*" ))
99+ print ("git :" .center (25 , "*" ))
91100 print (
92101 subprocess .check_output (
93102 ["git" , "describe" , "--tags" , "--long" , "--always" ],
@@ -99,18 +108,10 @@ def diagnose() -> None:
99108 print (sys .version )
100109 print (sys .version_info )
101110 print ("Done with version info." .center (50 , "*" ))
111+
102112 if run :
103- try :
104- print ("Skipping sync test..." )
105- # print("Sync Test Headless".center(50, "*"))
106- # browser = BrowserSync(headless=headless)
107- # browser.open()
108- # time.sleep(3)
109- # browser.close()
110- except Exception as e :
111- fail .append (("Sync test headless" , e ))
112- finally :
113- print ("Done with sync test headless" .center (50 , "*" ))
113+ print ("*" .center (50 , "*" ))
114+ print ("Actual Run Tests" .center (50 , "*" ))
114115
115116 async def test_headless () -> None :
116117 browser = await Browser (headless = headless )
@@ -141,5 +142,7 @@ async def test_headless() -> None:
141142 except Exception :
142143 print ("Couldn't print traceback for:" )
143144 print (str (exception ))
144- raise Exception ("There was an exception, see above." )
145+ raise Exception (
146+ "There was an exception during full async run, see above." ,
147+ )
145148 print ("Thank you! Please share these results with us!" )
0 commit comments