-
Notifications
You must be signed in to change notification settings - Fork 767
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
Unreachable mark but it is reachable #2093
Comments
Thanks for the bug report. This will be fixed in the next release. In the meantime, you can work around the problem by providing a return type annotation for your function: def tree(len) -> None:
... |
This issue has been fixed in version 2021.12.0, which we've just released. You can find the changelog here: CHANGELOG.md |
Getting same problem on VSC: Version: 1.63.2, Pylance v2022.1.0 and macOS. Happens after instantiating [edit] def __new__(cls, *args, **kwargs):
"""Would be called if trying to instantiate the class."""
raise errors.FactoryError('You cannot instantiate BaseFactory') If I comment it out, all code becomes reachable again. |
Hey @zigomir from api.models import Token
from datetime import datetime
from django.contrib.auth.models import User
from factory.django import DjangoModelFactory
class UserFactory(DjangoModelFactory):
"""
User Factory to be used on tests.
"""
password = ""
is_superuser = False
username = "test_user"
first_name = "Test"
last_name = "User"
email = "[email protected]"
is_staff = True
is_active = True
date_joined = datetime.utcnow()
class Meta:
model = User
django_get_or_create = ("username", "email", "is_active")
class TokenFactory(DjangoModelFactory):
"""
Token Factory to be used on our tests
"""
user = UserFactory()
name = "test_user_token"
identifier = "2e42a19593f047e080285e49864b0fb6"
secret = "6ff2dc141c0841e2a43c25be9ae9b097"
class Meta:
model = Token
django_get_or_create = ("user", "name", "identifier")
|
@adrianosmarinho, the problem you're seeing is this issue, which will be fixed in the next release. |
I am also encountering this issue, here is a sample of my code. Environment data
Code Snippet
The code after driver.quit() is marked as unreachable, even though it very much is. |
@adchang21, could you provide a self-contained minimal code sample? The sample above references symbols that are presumably imported from somewhere. Am I correct in assuming that you are using the selenium library? If so, are you using the latest version? There is a known bug in earlier versions of selenium that results in this behavior. Try |
Upgrading selenium fixed it, thank you! |
upgraded to version 4.3.0 but it said code unreachable import rqdatac # code below will treated as unreacable |
@adchang21, it looks like the issue you're hitting is not related to selenium. Your code snippet above references a module called |
This issue is closed. If you got here because you are seeing code that is marked as unreachable by pylance, it is most likely an issue in a library or type stub, not a bug in pylance. If you want help diagnosing the problem, please use the discussion tab. If you think that it is potentially a bug in pylance, please open a new bug report. Do not use this closed issue. And as with all bug reports, please include a self-contained minimal code example and specify which versions of third-party libraries the code sample imports. |
pylance v2021.11.2
python v3.9,6
os windows10 20H2 19042.1348
The text was updated successfully, but these errors were encountered: