Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Comments

fix #90: resolve circular import issue and add tests for decorator #159

Open
Rupeshkotha wants to merge 1 commit intofacebookincubator:mainfrom
Rupeshkotha:fix-decorator-rename-90
Open

fix #90: resolve circular import issue and add tests for decorator #159
Rupeshkotha wants to merge 1 commit intofacebookincubator:mainfrom
Rupeshkotha:fix-decorator-rename-90

Conversation

@Rupeshkotha
Copy link

Fix #90: Add tests for module renaming in decorators

Changes Made

  1. Added test cases to verify module renaming in decorators:
    • Simple decorator case: @decorator
    • Decorator with arguments case: @decorator(arg=42)
  2. Fixed circular import issues by renaming types.py to bowler_types.py

Test Results

All tests are passing:
collected 2 items
bowler/tests/test_decorator_module_rename.py::DecoratorModuleRenameTest::test_rename_module_in_decorator PASSED [ 50%]
bowler/tests/test_decorator_module_rename.py::DecoratorModuleRenameTest::test_rename_module_in_decorator_with_args PASSED [100%]

Verification

The changes ensure that:

  1. Module renaming works correctly in decorator syntax
  2. Both import statements and decorator usages are updated
  3. Decorator arguments are preserved during renaming
  4. No circular import issues occur

Example

Before:

from old_module import decorator

@decorator
def foo():
    pass

@decorator(arg=42)
def bar():
    pass

After:

from new_module import decorator

@decorator
def foo():
    pass

@decorator(arg=42)
def bar():
    pass

Related Issue

Fixes #90 - Module renaming in decorators

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Module name in decorator isn't renamed

2 participants