File tree 2 files changed +10
-10
lines changed
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -595,6 +595,7 @@ def start_automatic_run():
595
595
if runner .state != "spawning"
596
596
else logging .warning ("Spawning users, can't stop right now" ),
597
597
"\r " : lambda : webbrowser .open_new_tab (url ),
598
+ "\n " : lambda : webbrowser .open_new_tab (url ),
598
599
},
599
600
)
600
601
)
Original file line number Diff line number Diff line change @@ -942,14 +942,14 @@ def test_autospawn_browser(self):
942
942
"""
943
943
944
944
from pytest import MonkeyPatch
945
- import os
945
+ import sys
946
946
import webbrowser
947
947
948
948
monkeypatch = MonkeyPatch()
949
949
950
- def open_new_tab():
951
- print("browser opened" )
952
- os .exit(42 )
950
+ def open_new_tab(url ):
951
+ print("browser opened with url", url )
952
+ sys .exit(0 )
953
953
954
954
monkeypatch.setattr(webbrowser, "open_new_tab", open_new_tab)
955
955
print("patched")
@@ -975,16 +975,15 @@ def t(self):
975
975
stdout = PIPE ,
976
976
text = True ,
977
977
)
978
- gevent .sleep (2 )
979
- stdin .write (" \r " )
978
+ gevent .sleep (1 )
979
+ stdin .write (b" \n " )
980
980
try :
981
- output , _ = proc .communicate (timeout = 3 )
981
+ output , _ = proc .communicate (timeout = 1 )
982
982
except Exception :
983
983
proc .kill ()
984
- output , _ = proc .communicate (timeout = 1 )
984
+ output , _ = proc .communicate ()
985
985
986
- self .assertIn ("browser opened" , output .decode ("UTF-8" ))
987
- self .assertEqual (42 , proc .returncode )
986
+ self .assertIn ("browser opened" , output )
988
987
989
988
def test_spawning_with_fixed (self ):
990
989
LOCUSTFILE_CONTENT = textwrap .dedent (
You can’t perform that action at this time.
0 commit comments