"Run" command missing from context menu

Figured I'd post this just in case anyone else is having the same trouble.

When I right-click in some of my Python source files, there is no "Run" command in the right-click context menu.  The only way to run the file is by manually creating a run configuration.  I think I finally figured out the cause.

The problem seems to be triggered by the presence of any function name that starts with "test".  For example, the following function will likely prevent the "Run" command from being available in that file :

def test_foo():

     print "foobar"

I assume the presence of the "test" function causes PyCharm to think that the whole file is a unittest or something.

-Brien Voorhees

3 comments
Comment actions Permalink

Hello Brien,

This is a bug. Could you please file an issue at http://youtrack.jetbrains.net/

?

Figured I'd post this just in case anyone else is having the same

trouble.

When I right-click in some of my Python source files, there is no

"Run" command in the right-click context menu.  The only way to run

the file is by manually creating a run configuration.  I think finally

figured out the cause.

The problem seems to be triggered by the presence of any function name

that starts with "test".  For example, the following function will

likely prevent the "Run" command from being available in that file :

def test_foo():

print "foobar"

I assume the presence of the "test" function causes PyCharm to think

that the whole file is a unittest or something.

-Brien Voorhees

---

Original message URL:

http://devnet.jetbrains.net/message/5267211#5267211

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0
Comment actions Permalink

Ok, I submitted it as http://youtrack.jetbrains.net/issue/PY-1220 .

Cheers,

Brien Voorhees

0
Comment actions Permalink

This is some years ago, but still a bug. Renaming all function containing the word "test" in my script made the run buttons show up again.

0

Please sign in to leave a comment.