Skip to content

Commit 8de589c

Browse files
rchen152meta-codesync[bot]
authored andcommitted
Add regression test for django missing-module-attribute bug
Summary: Adds test for bug fixed in D85578780. Reviewed By: samwgoldman Differential Revision: D85582485 fbshipit-source-id: ab8bb38a835580da4c4c0f411f97227ee6416cfe
1 parent 66458aa commit 8de589c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/config.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,3 +298,18 @@ $ echo "from pkg import X" > $TMPDIR/foo.py && \
298298
ERROR * Found stubs for `pkg`, but no source* (glob)
299299
[1]
300300
```
301+
302+
## Regression test: we should still be able to find submodules when stubs are missing
303+
304+
```scrut {output_stream.stdout}
305+
$ mkdir $TMPDIR/site_package_missing_stubs && \
306+
> mkdir $TMPDIR/site_package_missing_stubs/django && \
307+
> touch $TMPDIR/site_package_missing_stubs/django/__init__.py && \
308+
> mkdir $TMPDIR/site_package_missing_stubs/django/forms && \
309+
> touch $TMPDIR/site_package_missing_stubs/django/forms/__init__.py && \
310+
> echo "from django import forms; from typing import reveal_type; reveal_type(forms)" > $TMPDIR/foo.py && \
311+
> $PYREFLY check $TMPDIR/foo.py --error untyped-import --site-package-path $TMPDIR/site_package_missing_stubs --output-format=min-text
312+
ERROR * Missing type stubs for `django` * (glob)
313+
INFO * revealed type: Module[django.forms] * (glob)
314+
[1]
315+
```

0 commit comments

Comments
 (0)