Archive for February 2013

Suicide is not a choice

There is a common misconception that those people who commit suicide have made a rational decision between two options and picked the one that they thought was most suitable for them. I’ve read this many times, often in the context of, “I really miss him, but I respect his choice.”

For those of you lucky enough to have never experienced suicidal thoughts, I want to make something clear:

Suicide is not a choice. It is a compulsion.

Obviously, I can’t really speak individually for the million people a year who take their own lives, nor for the order of magnitude more that failed in their attempt. There are, in fact, reasons for a mentally healthy person to choose (perhaps even rationally) to take their own lives. However, I believe that most of the people that killed themselves last year did not have a choice.

Consider a different illness for a moment. Consider cancer. It is a horrible disease. When a patient is diagnosed with cancer, they know they may recover, or that they may die. They don’t have a choice in the matter. Many patients find reserves within them to battle the illness with every tool available to them. Others don’t. Some survive, many die. Some beat the illness for a period, only to have the disease attack them again several years later.

In the case of cancer deaths, the cells in the human body turn on the victim to the point that it can no longer support that body’s vital systems.

Contrary to popular belief, mental illness works in much the same way. Instead of cells, it is the patient’s brain that turns on them. Their thoughts attack them repeatedly and incessantly until, eventually, they are compelled to destroy the body that houses them. Suicide is the result of an untreated psychological cancer.

Suicide ultimately arrives when the victim believes they do not have a choice. It becomes the only option. Suicidal thoughts begin as general thoughts about death. This leads to thoughts about the patient’s own death.They becomes obsessed, and begin to think about ways to actualize one or more of these scenarios. What options do they have, what tools can they use? Next, they are compelled to pick a time. If nothing changes, the time comes, and they die.

I speak from experience. Suicidal thoughts were my constant companion for twenty years, starting at the tender age of eight. At various times, I have reached the point where I believed I had no other options. I chose dates for my death. Luckily, phrases like, “I’d rather see you institutionalized than dead,” or “Do you need to be hospitalized” helped me realize there was something I hadn’t tried yet. I survived. At the moment, I am in remission, and I am optimistic that my “cancer” will not return.

So now, when I hear someone say, “It’s hard to deal with, but I respect her choice,” I hear the truth: “I am pretending she had a choice rather than admit that I didn’t give them the choice she needed.” Saying a suicide case had a choice is as insulting to their memory as suggesting that a cancer victim should have chosen to fight harder or a rape victim should have dressed differently.

Excluding tests with py.test 2.3.4 using -k selection

When I use py.test, I often rely on the -k switch to swiftly select the test I want to run. Instead of having to type the full module, class, and test path as is required with unittest and nose, I can just type a few characters that uniquely match the name of the test.

For example, if I have a test file containing methods test_basic_clone and test_basic_clone_notes, I can run the latter test simply by calling py.test -k clone_no.

However, I often create multiple tests that have similar names. This can make it difficult to run just one test if the test name is a prefix of a longer test name. If I want to run just test_basic_clone, any substring will also be a substring of the test_basic_clone_notes test, and both tests are matched by -k.

Since pytest version 2.3.4, the -k keyword supports expressions. So I can build an expression like this:

py.test -k "basic_clone and not notes"

This selects all tests matching “basic_clone”, then excludes any containing the word “notes”. Thus, I run only the test I’m interested in without having to fix my crappy naming scheme. It’s more typing than is normally the case, but is still less cognitive load than trying to remember what module and class I’m editing and constructing a selector based on those attributes.