diff --git a/_pytest/junitxml.py b/_pytest/junitxml.py index 84a872e4a..8f6c36ff9 100644 --- a/_pytest/junitxml.py +++ b/_pytest/junitxml.py @@ -206,7 +206,7 @@ class LogXML(object): def pytest_sessionfinish(self): dirname = os.path.dirname(os.path.abspath(self.logfile)) - if not os.path.exists(dirname): + if not os.path.isdir(dirname): os.makedirs(dirname) logfile = open(self.logfile, 'w', encoding='utf-8') suite_stop_time = time.time() diff --git a/_pytest/resultlog.py b/_pytest/resultlog.py index 44312d319..3670f0214 100644 --- a/_pytest/resultlog.py +++ b/_pytest/resultlog.py @@ -16,7 +16,7 @@ def pytest_configure(config): # prevent opening resultlog on slave nodes (xdist) if resultlog and not hasattr(config, 'slaveinput'): dirname = os.path.dirname(os.path.abspath(resultlog)) - if not os.path.exists(dirname): + if not os.path.isdir(dirname): os.makedirs(dirname) logfile = open(resultlog, 'w', 1) # line buffered config._resultlog = ResultLog(config, logfile)