In Divorce cases where children are involved it's sometimes appropriate to ask for a Psychological Evaluation or a Child Custody Evaluation. Generally these are not done in cases where children are not involved. The reason for this is that generally there is a concern that a parent may not have the psychological aptitude to nurture a child in a way that is appropriate for the child. A generally conscientious parent without any mental health history usually doesn't have to worry about this kind of testing. If mental health has been an issue in the past though, the request for these tests becomes more commonplace. A diagnosable mental health issue does not preclude a parent necessarily from caring for a child however. Many parents who suffer from depression or even bipolar or other mental illnesses can be fully capable, affectionate parents and their custody rights absolutely do not need to be curtailed in order to serve the best interests of the child.
You will hear this phrase many times ("the best interest of the child") because it is the standard by which the judge ultimately rules on parenting issues. This is also the standard under which a Guardian Ad Litem (an attorney appointed to represent the best interests of the children) will make their recommendation, which holds a great deal of weight with the court. In most of the cases you see where Psychological Evaluations or Child Custody Evaluations are asked for, you will have a Guardian Ad Litem. The issues and concerns that attend the appointment of a Guardian Ad Litem and Psychological Evaluations or Child Custody Evaluations have a great deal of overlap.
Now, one thing to realize is that a Psychological Evaluation and a Child Custody Evaluation are not the same. The children are not involved in a Psychological Evaluation. The Psychological Evaluation is for the adults, the parents. Generally, regardless of which parent is the parent of concern in regards to mental health, both will be required to have a Psychological Evaluation. There are exceptions to this rule, but not many. A Child Custody Evaluation on the other hand can involve the children but many of the processes are the same. It is less likely that a person would be diagnosed during a Child Custody Evaluation than in a Psychological Evaluation however. Also, it is not unusual to see both a Psychological Evaluation and a Child Custody Evaluation to be ordered at the same time.
Generally, parties consent to both have Psychological Evaluations, but compelling a party to do so is also a possibility. If a party can convince a judge that there is a good reason for the evaluation based on past conduct, then the evaluation will be ordered and the other party will be compelled to surrender to the evaluation. The reason most parties consent to the evaluation however is to show that they have nothing to hide. Now if neither party claims the other has any mental health issues, it is unlikely that this would be ordered. The only situation in which this might happen is when the Guardian Ad Litem has his or her own questions as to the state of the parent's mental health and a Guardian Ad Litem is well within their power to request this evaluation to be done. A judge will rarely say no to this relatively neutral party.
Lastly, one consideration about these types of evaluations are the records that will be opened up and available for perusal of the opposing party. Many judges will use the Guardian Ad Litem as a shield for the full records involving a mental health history. The Guardian Ad Litem will have access but no one else will until it becomes absolutely necessary, which in the domestic field of law is usually right before a trial. An evaluator will usually base their evaluation on whatever relevant materials they can find and that most certainly includes prior medical records and history of mental health. Therefore while the evaluation may be available as soon as it is finished, the underlying documents that are a partial basis for that evaluation may not be available until/if a trial marks the end of the case. In this way the court attempts to protect litigants health information as much as possible, but ultimately, once the evaluation is ordered, the opposing party can push the case to Trial and expose these prior medical records.