From 3a73b3072b26891b75bbd4a76986e51e2ad077ec Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Tue, 25 Jun 2024 21:05:16 -0400 Subject: [PATCH] Runnable identifier: optmize for the most common scenario The most common scenario is the runnable having its identifier format after its URI. When that's the case, there's no need to build the arguments to the formatting string and performing the string format itself. Signed-off-by: Cleber Rosa --- avocado/core/nrunner/runnable.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/avocado/core/nrunner/runnable.py b/avocado/core/nrunner/runnable.py index 18fb29a8a5..78bff90f8b 100644 --- a/avocado/core/nrunner/runnable.py +++ b/avocado/core/nrunner/runnable.py @@ -158,9 +158,8 @@ def identifier(self): """ fmt = self.config.get("runner.identifier_format", "{uri}") - # For the cases where there is no config (when calling the Runnable - # directly - if not fmt: + # Optimize for the most common scenario + if fmt == "{uri}": return self.uri # For args we can use the entire list of arguments or with a specific