Skip to content

Avoid failures due to non-deterministic binding ordering#10478

Merged
charliermarsh merged 1 commit intomainfrom
charlie/t
Mar 19, 2024
Merged

Avoid failures due to non-deterministic binding ordering#10478
charliermarsh merged 1 commit intomainfrom
charlie/t

Conversation

@charliermarsh
Copy link
Member

Summary

We're seeing failures in #10470 because resolve_qualified_import_name isn't guaranteed to return a specific import if a symbol is accessible in two ways (e.g., you have both import logging and from logging import error in scope, and you want logging.error). This PR breaks up the failing tests such that the imports aren't in the same scope.

Closes #10470.

Test Plan

I added a bindings.reverse() to resolve_qualified_import_name to ensure that the tests pass regardless of the binding order.

@charliermarsh charliermarsh added the testing Related to testing Ruff itself label Mar 19, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) March 19, 2024 18:01
@charliermarsh charliermarsh merged commit bc9b457 into main Mar 19, 2024
@charliermarsh charliermarsh deleted the charlie/t branch March 19, 2024 18:01
@charliermarsh
Copy link
Member Author

Would also be solved by #10479.

@github-actions
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to testing Ruff itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests fails on 32 bits archs

1 participant