PyCharm get rid of doctest background color

Viewed 103

Is there a way to remove the green highlighting in the doctest in PyCharm?

enter image description here

Or am I doing something wrong in the first place? And that is the reason why the code is highlighted?

1 Answers

am I doing something wrong and that is the reason why the code is highlighted?

The green background is the default syntax highlight PyCharm uses for doctests. So no, there's nothing wrong its purpose is to help differentiate from the surrounding code.

Is there a way to remove the green highlighting in the doctest in PyCharm?

Yes. You can remove the background color by going to File > Settings > Editor > Color Scheme > General > Code > Injected language fragment and changing the Background value as shown in the screenshot.

enter image description here

Related