diff --git a/tests/core.py b/tests/core.py index ec6f14060f886..278ea69335ca0 100644 --- a/tests/core.py +++ b/tests/core.py @@ -62,6 +62,7 @@ from airflow.utils.dates import days_ago, infer_time_unit, round_time, scale_time_units from airflow.utils.state import State from airflow.utils.timezone import datetime +from airflow.version import version from tests.test_utils.config import conf_vars DEV_NULL = '/dev/null' @@ -1795,6 +1796,12 @@ def test_variables(self): os.remove('variables2.json') os.remove('variables3.json') + def test_cli_version(self): + with mock.patch('sys.stdout', new_callable=io.StringIO) as mock_stdout: + cli.version(self.parser.parse_args(['version'])) + stdout = mock_stdout.getvalue() + self.assertIn(version, stdout) + def _wait_pidfile(self, pidfile): while True: try: