(CNN) Throughout history and across cultures, people have written songs and poems lamenting lost loves. Now, researchers at a French university say they have discovered that fish also pine for their partners, challenging the view that only humans form emotional attachments.

JUST WATCHED Rare 'walking' fish found Replay More Videos ... MUST WATCH Rare 'walking' fish found 00:57

Researchers at the University of Burgundy performed a series of tests on convict cichlids -- a species of small, monogamous fish native to Central America -- to measure their mood and emotional attachment.

They allowed 33 female fish to choose a male mate and then monitored the behavior of the females when they were not paired with their preferred partner. They found that the females who were denied their first choice adopted a more "pessimistic" outlook on life.

The study, published Wednesday in The Proceedings of the Royal Society B journal, found that females separated from a preferred partner showed a "pessimistic bias" -- in other words, a bleaker outlook on life -- when presented with a challenge.

In a series of tests, researchers trained the fish to recognize and open boxes, distinguishable by their color and position in the tank: a "positive" box filled with a reward of food and an empty "negative" box. Biologists then presented the fish with a third "ambiguous" box and measured the reactions of the female fish before and after separation from their preferred partner.

Read More