@@ -100,10 +100,8 @@ def load_unittesting_settings(self, package, options):
100
100
def default_output (self , package ):
101
101
outputdir = os .path .join (
102
102
sublime .packages_path (), 'User' , 'UnitTesting' , "tests_output" )
103
- if not os .path .isdir (outputdir ):
104
- os .makedirs (outputdir )
105
- outfile = os .path .join (outputdir , package )
106
- return outfile
103
+ os .makedirs (outputdir , exist_ok = True )
104
+ return os .path .join (outputdir , package )
107
105
108
106
def load_stream (self , package , settings ):
109
107
output = settings ["output" ]
@@ -117,9 +115,8 @@ def load_stream(self, package, settings):
117
115
if sublime .platform () == "windows" :
118
116
output = output .replace ("/" , "\\ " )
119
117
output = os .path .join (sublime .packages_path (), package , output )
120
- if os .path .exists (output ):
121
- os .remove (output )
122
- stream = open (output , "w" )
118
+ os .makedirs (os .path .dirname (output ), exist_ok = True )
119
+ stream = open (output , "w" , encoding = "utf-8" )
123
120
124
121
return stream
125
122
0 commit comments