From ad33adeaa161aec10e672e07d6381a358bba8731 Mon Sep 17 00:00:00 2001 From: Jonathan van der Steege Date: Sun, 1 May 2022 16:41:43 +0200 Subject: [PATCH] bdd-test doesn't add version if file is (and should stay) empty. --- tests/lib/given_steps.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/lib/given_steps.py b/tests/lib/given_steps.py index ba619dba..dd7c4720 100644 --- a/tests/lib/given_steps.py +++ b/tests/lib/given_steps.py @@ -101,7 +101,11 @@ def we_use_the_config(request, temp_dir, working_dir): # @todo get rid of this by using default config values # merge in version number - if config_file.endswith("yaml") and os.path.exists(config_dest): + if ( + config_file.endswith("yaml") + and os.path.exists(config_dest) + and os.path.getsize(config_dest) > 0 + ): # Add jrnl version to file for 2.x journals with open(config_dest, "a") as cf: cf.write("version: {}".format(__version__))