diff --git a/test_elasticsearch/test_server/test_rest_api_spec.py b/test_elasticsearch/test_server/test_rest_api_spec.py index 6db2b1125..ea542efba 100644 --- a/test_elasticsearch/test_server/test_rest_api_spec.py +++ b/test_elasticsearch/test_server/test_rest_api_spec.py @@ -502,7 +502,7 @@ def remove_implicit_resolver(cls, tag_to_remove): http = urllib3.PoolManager(retries=urllib3.Retry(total=10)) branch_candidates = [] - if "ES_YAML_TESTS_BRANCH" in os.environ: + if "ES_YAML_TESTS_BRANCH" in os.environ and os.environ["ES_YAML_TESTS_BRANCH"]: branch_candidates.append(os.environ["ES_YAML_TESTS_BRANCH"]) git_branch = subprocess.getoutput("git branch --show-current") if git_branch not in branch_candidates: