Skip to content

Fix module resolution bug #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 29, 2025
Merged

Conversation

bagel897
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Jan 29, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
1881 1 1880 57
View the top 1 failed tests by shortest run time
tests.unit.codegen.sdk.python.import_resolution.test_import_resolution test_import_resolution_nested_module
Stack Traces | 0.062s run time
tmpdir = local('.../pytest-0/popen-gw14/test_import_resolution_nested_0')

    def test_import_resolution_nested_module(tmpdir: str) -> None:
        """Tests import resolution works with nested module imports"""
        # language=python
        with get_codebase_session(
            tmpdir,
            files={
                "a/b/c.py": """
    def d():
        pass
    """,
                "consumer.py": """
    from a import b
    
    b.c.d()
    """,
            },
        ) as codebase:
            consumer_file: SourceFile = codebase.get_file("consumer.py")
            c_file: SourceFile = codebase.get_file("a/b/c.py")
    
            # Verify import resolution
            assert len(consumer_file.imports) == 1
            import_stmt = consumer_file.imports[0]
            resolution = import_stmt.resolve_import()
>           assert resolution is not None
E           assert None is not None

.../python/import_resolution/test_import_resolution.py:278: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@bagel897 bagel897 marked this pull request as ready for review January 29, 2025 23:36
@bagel897 bagel897 requested review from codegen-team and a team as code owners January 29, 2025 23:36
@bagel897 bagel897 requested review from EdwardJXLi and removed request for a team January 29, 2025 23:36
@bagel897 bagel897 enabled auto-merge (squash) January 29, 2025 23:37
@bagel897 bagel897 merged commit 4a3f2d5 into develop Jan 29, 2025
8 checks passed
@bagel897 bagel897 deleted the eagarwal/fix-import-resolution-bug branch January 29, 2025 23:45
bagel897 added a commit that referenced this pull request Jan 30, 2025
codegen-team pushed a commit that referenced this pull request Jan 30, 2025
jayhack pushed a commit that referenced this pull request Feb 9, 2025
jayhack pushed a commit that referenced this pull request Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants