You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title is self descriptive.
I am using unittest-xml-reporting with Django specifying both TEST_OUTPUT_DIR and TEST_OUTPUT_FILE_NAME.
According to the README for the TEST_OUTPUT_DIR setting: " If the directory couldn't be found, the test runner will try to create it before generate the XML files."
Also for TEST_OUTPUT_FILE_NAME: "Tells the test runner to output a single XML report with this filename under os.path.join(TEST_OUTPUT_DIR, TEST_OUTPUT_FILE_NAME)".
That implies that using both settings is allowed and intermediate folders will be created.
The problem is that intermediate folders will be created using os.makedirs in xmlrunner/result.py:451 if test_runner.output is a string, but when using TEST_OUTPUT_FILE_NAME test_runner.output is a file object opened in xmlrunner.extra.djangotestrunner.py:35. That line fails if intermediate folders do not exist.
I guess the simplest solution is to also run os.makedirs before the context manager opening the file.