Search code examples
pythonpycharmjetbrains-idegutter

What is a "line marker" icon in PyCharm?


What is this "line marker" icon in the gutter in PyCharm IDE? When does it appear exactly?

I looked up but this doesn't explain much about the icon itself.

enter image description here


Solution

  • The "Line Marker" (or green run icon) in the gutter is added by PyCharm to special lines the IDE considers as runnable. This is not only the case for lines containing a Top level script enviorment but also frequent with executable test functions from testing frameworks, for example with pytest among others.

    The PyCharm IDE detects these automatically (for example by prefixing a function name with test and having a testing framework configurered). One good example of this is the following thread where the IDE makes a mistake detecting a line as runnable, see PyCharm: FooTestCase is no test, but FooTest is.