Skip to content

Commit 6698c93

Browse files
rubmarymeta-codesync[bot]
authored andcommitted
Adding test with __all__
Summary: We currently do not record xrefs for symbols in ` __all__` which is a gap compared to the current python indexer. I am adding a test in this diff and adding the functionality on the diff on top. Reviewed By: malanka Differential Revision: D85448314 fbshipit-source-id: e8aecefc0572b0d9a01a9122b80c41ab5369bb1c
1 parent 46ffedb commit 6698c93

File tree

2 files changed

+871
-0
lines changed

2 files changed

+871
-0
lines changed

pyrefly/lib/report/glean/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ class B:
170170
return False
171171
"#;
172172

173+
let exports_all = r#"from typing import Union as U
174+
x = 1
175+
y = 2
176+
177+
__all__ = ["x", "U"]
178+
179+
__all__ += ["y"]
180+
"#;
181+
173182
let files = [
174183
("simple", simple_code),
175184
("classes", classes_code),
@@ -178,6 +187,7 @@ class B:
178187
("return_types", return_types),
179188
("calls", calls),
180189
("type_lit_str", type_lit_str),
190+
("exports_all", exports_all),
181191
];
182192
let (handles, state) = mk_multi_file_state_assert_no_errors(&files, Require::Everything);
183193
let transaction = state.transaction();

0 commit comments

Comments
 (0)