I have copied a .py file from my teacher, and loaded it in to a project in Pycharm 4.04. When i tried to right-click and run it, it shows "Run Doctests in 'foo.py'" instead of the regular "Run 'foo.py'", and i cannot find out how to run it normally.
I searched for 'doctest' in settings and found nothing, and in PyCharm documentation here, there's nothing about disabling doctests either.
I found a similar question here: Pycharm won't allow to run a file. Shows run unittest option only. and tried the suggested solution, but it still showed "Run doctests in 'foo.py'" in context menu.
Just had the same issue. In my case, I had a '>>>' string within the docs of a function:
def foo(x):
"""Do foo.
Example:
>>>foo(1)
# Out: 1
"""
return x
I had to comment out # >>>foo(1)
and delete the run config under Run > Edit Configurations (minus symbol).
I'm having the same Run 'Doctests in __init__' issue with PyCharm 2016. I'm not sure if this is due to the same problem other people are having, but this is my fix.
I noticed the file that won't run lives in a resource directory:
Once I opened a new PyCharm project with the script I want to run not in a resource directory, PyCharm ran it with no problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With