Skip to content
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

Avoid failures due to non-deterministic binding ordering #10478

Merged
merged 1 commit into from Mar 19, 2024
Merged

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
17 checks passed
@charliermarsh charliermarsh deleted the charlie/t branch March 19, 2024 18:01
@charliermarsh
Copy link
Member Author

Would also be solved by #10479.

Copy link

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