diff --git a/CHANGES b/CHANGES index 5d2116f..9a4c648 100644 --- a/CHANGES +++ b/CHANGES @@ -13,15 +13,24 @@ The rules for this file: * release numbers follow "Semantic Versioning" https://semver.org ------------------------------------------------------------------------------ +2022-??-?? xiki-tempula + + * 0.3.2 + +Fixes + +- enable logger output for -v (issue #25) + 2022-12-06 xiki-tempula, hejamu * 0.3.1 - Fixes +Fixes - Handle 0 as input to the forwrev (Issue #18/ PR #20). + 2022-11-09 xiki-tempula, orbeckst * 0.3.0 diff --git a/flamel/flamel.py b/flamel/flamel.py index d4b1d66..8709566 100644 --- a/flamel/flamel.py +++ b/flamel/flamel.py @@ -173,7 +173,10 @@ def main(): # Print the logging to the console if args.verbose: - logging.getLogger().addHandler(logging.StreamHandler()) + logging.basicConfig( + level=logging.INFO, + handlers=[logging.StreamHandler()], + ) if args.output_directory == "": out = args.datafile_directory diff --git a/flamel/tests/test_flamel.py b/flamel/tests/test_flamel.py index 28f0012..361d0b1 100644 --- a/flamel/tests/test_flamel.py +++ b/flamel/tests/test_flamel.py @@ -6,6 +6,7 @@ import sys import pathlib import pickle +import subprocess import pytest from numpy.testing import assert_approx_equal @@ -47,6 +48,17 @@ def test_dhdl_TI(self, setup): assert (setup / "dhdl_TI.pdf").exists() +def test_verbose(): + p = subprocess.Popen( + ["flamel", "-v"], stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) + out, err = p.communicate() + assert ( + "INFO:alchemlyb.workflows.ABFE:Initialise Alchemlyb ABFE Workflow" + in err.decode() + ) + + class TestFlamelOptions(TestFlamel): @staticmethod @pytest.fixture(scope="session")