aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/util.d15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/util.d b/source/util.d
index 02c74b8..101645a 100644
--- a/source/util.d
+++ b/source/util.d
@@ -102,6 +102,15 @@ string safe_install(string specs) {
string pytest_xunit2(string filename) {
+ if (!filename.exists) {
+ auto dummy = File(filename, "w+");
+ dummy.write("");
+ dummy.flush();
+ dummy.close();
+ }
+
+ string _data = readText(filename);
+ string data;
string result;
bool inject = false;
bool inject_wait = false;
@@ -110,12 +119,6 @@ string pytest_xunit2(string filename) {
string section;
immutable string key = "junit_family";
immutable string cfgitem = key ~ " = xunit2";
- string _data = readText(filename);
- string data;
-
- if (!filename.exists) {
- File(filename, "w+").write("");
- }
if (filename.baseName == "setup.cfg") {
section = "[tool:pytest]";