Correction: An earlier version of this article incorrectly identified Christine Baranski’s husband. This version has been updated.

Christine Baranski as Diane on “The Good Wife.” (Myles Aronowitz/CBS)

Christine Baranski, who plays the besieged but derriere-kicking Chicago attorney Diane Lockhart on the CBS drama “The Good Wife,” says her character has been through so much in the last few months that it was “harrowing” for both of them.

The self-mocking teaser for Sunday night’s season finale — “Loyalties will be tested. Lines will be crossed. Lasagna will be served.” — signals that the show’s writers know viewers could use some laughs this week, too.

Since the courtroom shooting death of Diane’s law partner, Will Gardner (played by Josh Charles), she’s moved not only into his role running the firm they started together, but has inherited some of his “backatcha” bravado, too. Through most of the show’s first five seasons, Diane was elegant but understated, a moderating and mediating presence only sporadically at the center of the action while Will and “The Good Wife” herself, the Illinois governor’s spouse, Alicia Florrick, played by Julianna Margulies, fell in love and tried to stay apart.

But that’s changed now, of course – to the point that the men in the show increasingly feel like supporting characters next to three complicated and very different female stars, including the rule-bending in-house investigator Kalinda Sharma, played by Archie Panjabi. Recently, Baranski’s character even got to deliver a variation of Bette Davis’s iconic line as Margo Channing in “All About Eve”: “Fasten your seatbelts; it’s going to be a bumpy night.”

When Diane’s smarmy, back- and front-stabbing partner David Lee, played by Zach Grenier, tells her, “I have some advice for you; when in mourning, don’t make big decisions, at least for a year,’’ she responds by relocating him to a back office: “Is that a big enough decision for you?” (In the unlikely event you somehow missed Diane’s shift into Will-like willfulness, her character later spelled it out: “It’s like I’m channeling Will.”)

In a phone interview just ahead of the finale, Baranski said her character’s evolution is on fast-forward because Diane is “living very close to the bone” after losing the judgeship that was her life’s ambition and feeling so personally betrayed when Alicia and Cary left the firm to start their own. Then, “when she was just getting back on terra firma with Will” after speaking ill of him in a news interview, she lost him forever in such a shocking and traumatic way.

“Now she has no time for nonsense or false emotion,’’ the 62-year-old actress says of her character. This was seen when Diane returned to her law office, numb after identifying Will’s corpse, and fired not just a weeping intern who’d barely known him, but an important client who had the bad taste to demand that she do business on such a day. “She becomes ruthless in a way we’ve not seen,” Baranski says. She also realizes that the only way to save her firm, at least for the moment, is to merge with “the Devil” in the form of her unscrupulous new law partner, Louis Canning, played by Michael J. Fox. “She’s acting from an animal sense of expediency,” Baranski notes.

Asked who she’s looked to for inspiration in bringing Diane alive Baranski immediately answers that “obviously, Hillary Clinton’’ is in the mix. There’s the Chicago connection, of course, and the combo of high-mindedness and personal ambition. Diane “holds herself to a very high standard, is someone who reads David Brooks religiously,” according to Baranski, and was “a Daddy’s girl.”

Hillary Clinton has certainly never been the couture-lover that Diane Lockhart is: “I’m once again lucky to play a clotheshorse; I think Diane has a personal shopper at Saks.” But HRC might be able to teach Diane a thing or two about realpolitik, even as played out in the office. Female newscasters, including NBC’s Andrea Mitchell “with that full-frontal, authoritative tone,” also inform the role.

After losing Will, Baranski says, she for the first time in her life “almost doesn’t have time to examine the morality” that’s always been at her core.

Always? Didn’t she sell out her dear friend Will when she thought she’d have to badmouth him in print to get the judgeship that was denied her in the end?

“I don’t mean to defend her too acutely,” Baranski says. “But I think it was one of those moments where the interviewer led her to say things that then couldn’t be unsaid; the reporter was out to entrap her.”

Her Diane has also been doing some Margo Channing-level martini swilling lately – though not to the extent of her character on ’90s sitcom “Cybill” — and Baranski says her post-funeral martini scene with Alicia was one of her favorites in a season that she feels might have been their best:“I always thought there’s no reason why those two women shouldn’t be friends, and I love that over the course of five years, as [other] relationships are falling away, they are more and more moving through the world on their own authority.”

Speaking of which, we’ve seen so little of Diane’s husband lately. Is she even married any more?

Yes, but Gary Cole, who plays her “gun-toting cowboy” of a husband, is busy with his own office politics over on “Veep.”

“I kind of like that you don’t see her marriage, because it’s a very personal thing,” Baranski says. “She goes home to her cowboy, and they cook and have great sex.”

Baranski herself has been married only once, since 1983, to the actor Matthew Cowles, of the Cowles publishing family, who for years played the pimp Billy Clyde Tuggle on the now-cancelled ABC soap opera “All My Children.” So what relationship advice would Christine give poor reeling Alicia, who since Will’s death told her husband, the governor, played by Chris Noth, that they are married in name only?

“Oh,’’ she says, laughing hard. “Never marry a politician. Of course, I also say, ‘Never marry an actor.’ I was lucky, but beware of men with grand personal ambitions, because there’s such a shadow to them.”

Everywhere Baranski goes, she says, women tell her “they’re so grateful to see a woman who’s a female boss’’ on the screen. One of her favorite compliments came from her fellow actor Elisabeth Moss, who plays Peggy Olson on “Mad Men,” and said in a recent interview with Rolling Stone that she thought Peggy would have grown up to be a lot like Diane Lockhart.

“She’s not a pill-popper, she’s not a harpy; she’s a well-rounded, intelligent woman,” Baranski says of Lockhart. “You channel-surf and everywhere you look there’s the body of another woman who’s been violated, but this show does not rely on sensationalism.”

The Good Wife (one hour) season finale airs Sunday at 9 p.m. on CBS.