bdd-test doesn't add version if file is (and should stay) empty.

This commit is contained in:
Jonathan van der Steege 2022-05-01 16:41:43 +02:00
parent 0dd7ec798c
commit ad33adeaa1

View file

@ -101,7 +101,11 @@ def we_use_the_config(request, temp_dir, working_dir):
# @todo get rid of this by using default config values # @todo get rid of this by using default config values
# merge in version number # 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 # Add jrnl version to file for 2.x journals
with open(config_dest, "a") as cf: with open(config_dest, "a") as cf:
cf.write("version: {}".format(__version__)) cf.write("version: {}".format(__version__))