uriyyo / pycharm-evaluate-async-code

Finally, you can use await in evaluate expression 💪
https://plugins.jetbrains.com/plugin/14476-evaluate-async-code
44 stars 2 forks source link

When debugging code, normal code breaks can lead to different runtime results #39

Closed wordhui closed 3 years ago

wordhui commented 3 years ago

First of all, I am very sorry, I am not completely sure that this bug is caused by this plug-in, first submit an issue, record the problem situation

When I was using tortoise-orm, debugging the code, I found that line breaks will affect the results of code execution, the following is a GIF recorded when the problem occurs in the project image

wordhui commented 3 years ago

I wrote minimaI wrote minimalist code to reproduce the buglist code to reproduce the bug

import asyncio

from tortoise.models import Model
from tortoise import Tortoise, fields

class User(Model):
    username = fields.TextField()
    password = fields.TextField()

async def init():
    await Tortoise.init(
        db_url='sqlite://Data.db',
        modules={'models': ['__main__']}
    )
    await Tortoise.generate_schemas()
    await User.create(username='张三', password='123456')
    await User.create(username='李四', password='123456')

async def main():
    await init()
    await User.filter(username='张三', password='123456').first()  # The bug can be reproduced by typing a breakpoint here
    await User.filter(username='李四', password='123456').first()

if __name__ == '__main__':
    asyncio.get_event_loop().run_until_complete(main())

The simple code reproduces the bug image as follows image

uriyyo commented 3 years ago

@wordhui Thanks for submitting issue, I will take closer look.

wordhui commented 3 years ago

python version Python 3.8.8 (default, Feb 24 2021, 15:54:32) [MSC v.1928 64 bit (AMD64)] :: Anaconda, Inc. on win32 tortoise-orm version 0.17.6 evaluate-async-code version 1.14

wordhui commented 3 years ago

@wordhui Thanks for submitting issue, I will take closer look.

@uriyyo Thanks I finally updated the plugin version and the bug image, which may help

uriyyo commented 3 years ago

@wordhui This fix will be available at version 1.15.

wordhui commented 3 years ago

@wordhui This fix will be available at version 1.15.

Many thanks
I will wait for the plugin to be released and upgrade The efficiency of the fix is commendable