Skip to content

Commit

Permalink
Correctly loading the methods from relatively imported classs (additi…
Browse files Browse the repository at this point in the history
…on to #360)

Signed-off-by: Kunal Vishwasrao <[email protected]>
  • Loading branch information
kunalvishwasrao committed Jul 3, 2024
1 parent 79d000b commit 4161583
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions getgauge/impl_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def _import_file(base_dir, file_path):

# Inject instace in each class method (hook/step)
def update_step_resgistry_with_class(instance, file_path):
# Resole the absolute path from relative path
file_path = os.path.abspath(file_path) if '..' in file_path else file_path
for info in registry.get_all_methods_in(file_path):
class_methods = [x[0] for x in inspect.getmembers(instance, inspect.ismethod)]
if info.impl.__name__ in class_methods:
Expand Down

0 comments on commit 4161583

Please sign in to comment.