Describe the bug
In an existing code base with lots of pytest tests, after installing the AWS toolkit, the run configurations for tests with two input parameters (i.e., fixtures) show up as lambdas and launch the lambda run config when clicking the play icon. However, tests which do not have two parameters do not have this problem.



To reproduce
test_anything(), gets lambda popuptest_anything2(), runs pytest as expectedExpected behavior
In both cases, pytest should run the test and not cause the lambda run configuration dialog to come up
Your Environment
/usr/local/bin/python -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python which is 2.7.16. This is the version that gets called by PyCharm, despite having sam installed in the project's conda environment.Can you double check to see if you enabled the AWS setting Show gutter icons for all potential AWS Lambda handlers?
You can do this by PyCharm -> Preferences -> Tools -> AWS -> Project settings. For a workaround, you can turn off this check to avoid the Toolkit recognizing arbitrary suspicious functions.
Thanks @zhangzhx. Indeed, I can turn off the gutter icons. However, even after I do that, when I click the play button on the test, even though it says "run pytest..." it still launches the dialog to run as if it were a lambda.
I should mention that I am now using the aws toolkit version 1.4. sam version 0.17.0.
That sounds super strange, we will need to dig into that discrepancy
Hey guys, I'm getting the same issue. Have you find any workaround for this?
Here is the old youtrack issue that is the root cause: https://youtrack.jetbrains.com/issue/IDEA-135770
We do not have a workaround yet, we may have to put in some heuristic to disable it or something along those lines
Edit: As in the youtrack, you can use Ctrl+Alt+R (on OS X) to work around it for now
Here is the old youtrack issue that is the root cause: https://youtrack.jetbrains.com/issue/IDEA-135770
We do not have a workaround yet, we may have to put in some heuristic to disable it or something along those lines
Edit: As in the youtrack, you can use Ctrl+Alt+R (on OS X) to work around it for now
Is there any update on this? It looks like the youtrack is 5 years old so it feels lost in the backlog.
One thing to note, the UI looks like it wants to run pytest, but then Pycharm choses to try to generate an AWS Lambda
Ctrl-Alt-R sets up the configuration correctly and then you can use the play button after, but that's not a great workaround, since the issue is per test function and not per file

Edit: it seems the best workaround is to completely uninstall the AWS toolkit, which fixes the issue
Here is the old youtrack issue that is the root cause: youtrack.jetbrains.com/issue/IDEA-135770
We do not have a workaround yet, we may have to put in some heuristic to disable it or something along those lines
Edit: As in the youtrack, you can use Ctrl+Alt+R (on OS X) to work around it for nowIs there any update on this? It looks like the youtrack is 5 years old so it feels lost in the backlog.
One thing to note, the UI looks like it wants to run pytest, but then Pycharm choses to try to generate an AWS Lambda
Ctrl-Alt-R sets up the configuration correctly and then you can use the play button after, but that's not a great workaround, since the issue is per test function and not per file
Edit: it seems the best workaround is to completely uninstall the AWS toolkit, which fixes the issue
Sorry for being quiet, this fell through the cracks and I apologize.
We are going to work around the IntelliJ bug and add checks in our logic:
test_ to avoid conflicting with pytest logicChange has been released in 1.12
Please re-open if the issue is still showing up with v1.12
awesome, thanks!
Most helpful comment
Sorry for being quiet, this fell through the cracks and I apologize.
We are going to work around the IntelliJ bug and add checks in our logic:
test_to avoid conflicting with pytest logic