In Epps v. Fowler, 351 S.W.3d 862 (Tex. 2011), the Texas Supreme Court held that "a defendant may be a prevailing party when a plaintiff nonsuits without prejudice if the trial court determines, on the defendant's motion, that the nonsuit was taken to avoid an unfavorable ruling on the merits." 351 S.W.3d at 870.
The Supreme Court enumerated factors that may support an inference that a plaintiff nonsuited to avoid an unfavorable ruling:
(1) a plaintiff filed a nonsuit only after a defendant filed a motion for summary judgment;
(2) a plaintiff failed to respond to requests for admission or other discovery that could support an adverse judgment;
(3) a plaintiff failed to timely identify experts or other critical witnesses;
(4) the existence of other procedural obstacles that could defeat the plaintiff's claim (e.g., an inability to join necessary parties). Id. at 870-71.
On the other hand, the Epps court noted that evidence that a plaintiff's suit was not without merit when filed may indicate that the defendant has not prevailed and therefore is not entitled to attorney's fees. Id. (suggesting that a defendant would not be a prevailing party if suit was not without merit when filed and was non-suited after discovery revealed previously unknown flaws in plaintiff's claims).