diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-06-01 00:00:20 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-06-01 00:00:20 -0400 |
commit | 3084ac0a8557cd0e3b02645a10559cdec1bf0430 (patch) | |
tree | eaf4f55d68f19f2b317c3f1c7389e5abfc07c0c8 /source | |
parent | 6c9eef788b5ce453f880abbc7bec22bfa104827d (diff) | |
download | dm-3084ac0a8557cd0e3b02645a10559cdec1bf0430.tar.gz |
Bugfix: create setup.cfg|pytest.ini if missing
Diffstat (limited to 'source')
-rw-r--r-- | source/util.d | 15 |
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]"; |