From 1fe1d505a63b1eced98523c0cca7603ab165218f Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 31 May 2019 23:06:30 -0400 Subject: Bugfix: Create setup.cfg|pytest.ini if does not exist --- source/util.d | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/util.d') diff --git a/source/util.d b/source/util.d index 8f2ad8d..02c74b8 100644 --- a/source/util.d +++ b/source/util.d @@ -102,8 +102,6 @@ string safe_install(string specs) { string pytest_xunit2(string filename) { - string _data = readText(filename); - string data; string result; bool inject = false; bool inject_wait = false; @@ -112,6 +110,12 @@ 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]"; -- cgit