From c3030f2cdd0886623a461f3a5e47ac7a0c60b4ba Mon Sep 17 00:00:00 2001 From: Grzegorz Banasiak Date: Thu, 20 Nov 2025 10:23:23 +0100 Subject: [PATCH] Remove Rally configuration file robustly --- pytest_rally/rally.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pytest_rally/rally.py b/pytest_rally/rally.py index fb28693..4dcb5cf 100644 --- a/pytest_rally/rally.py +++ b/pytest_rally/rally.py @@ -89,7 +89,10 @@ def install_config_file(self): def delete_config_file(self): self.logger.info("Removing Rally config from [%s]", self.config_location) - os.remove(self.config_location) + try: + os.remove(self.config_location) + except FileNotFoundError: + self.logger.warning("Rally config file not found at [%s]", self.config_location) def set_revision(self): self.revision = process.run_command_with_output(f"esrally --version").rstrip()