From 26530244097796ae0766c63215f871cd7665aefc Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 17 Jun 2015 08:08:03 -0300 Subject: [PATCH] Use os.path.isdir instead of os.path.exists As suggested during review --- _pytest/junitxml.py | 2 +- _pytest/resultlog.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)