We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1410ef5 commit 153d998Copy full SHA for 153d998
src/rust/engine/dep_inference/src/python/tests.rs
@@ -279,6 +279,8 @@ fn dunder_import() {
279
) # pants: no-infer-dep",
280
&[],
281
);
282
+
283
+ // Concatenated strings are accepted.
284
assert_imports(
285
"
286
__import__(
@@ -290,6 +292,11 @@ fn dunder_import() {
290
292
",
291
293
&["foo.bar.xyzzy.funky"],
294
295
296
+ // f-strings with interpolations are ignored
297
+ assert_imports("__import__(f'foo.{name}')", &[]);
298
+ assert_imports("__import__(f'foo.{{name}}')", &[]);
299
+ assert_imports("__import__(f'foo.bar\n')", &[]);
300
}
301
302
fn assert_imports_strong_weak(code: &str, strong: &[&str], weak: &[&str]) {
0 commit comments