I don't know what I did, or what settings I messed with, but I've been using Pycharm for months now, and all of a sudden I stepped into some functionality that I can't get out of.
I'm still relatively new to python, so I set up a simple test of a Python object. I wanted to see if the object would get updated inside a called function...but that is beside the point. Somehow, through naming convention or something, I managed to convince Pycharm to switch to doing "nosetests" when I press debug or run...instead of running the code. The console outputs nothing...and the situation is impossible to google...
Anyhow, I did the following inside a Pycharm Python project:
I created a directory named scratch (there is an __init__.py
file in it), and then a python file named scratch.py
.
Inside scratch.py
, I wrote the following code:
def add_item_function(x):
x.list.append("hello,world")
class scratch(object):
def __init__(self):
self.list = []
def add_item(self):
add_item_function(self)
x = scratch()
add_item_function(x)
print(x.list)
y=1 #<-- here is where I put the breakpoint
And no matter what I do, the IDE only runs "nosetests" ... I tried putting the breakpoint in...and the code will actually hit the breakpoint on the debug...but the only output to the console pertains to the "nosetest" and not my code.
Further, I changed nothing. I have been doing this all the time--making classes and then running functions and code beneath them...and this has never happened before.
I found the configuration for the debugging...and Nosetests default to "scripts" in the project...but I can't disable it--it is a radio button. Some portion of my code apparently must be a nosetest...How do I toggle this/turn it off, and get the program to run the way I am telling it to?