RICHMOND, Va. — Hanging over Virginia’s closely watched race for governor has been the open question of whether President Donald Trump and former President Barack Obama would make an endorsement in the upcoming primary.

Virginia’s off-year contest is drawing national attention as both a quasi-referendum on Trump’s first year and the future of the Democratic Party.

But neither Trump nor Obama have made an endorsement and are not expected to wade into the race with Tuesday’s primary only days away, denying a potential boost to insurgent candidates in both parties who have been strongly loyal to the president or his predecessor.

Prominent politicians usually stay out of intraparty contests in order to avoid upsetting their supporters and risk losing perceived influence if their chosen candidate loses. But Trump has shown a willingness to buck tradition and back candidates in contests prominent politicians typically ignore, and Obama’s connections to one of the Democratic candidates run deep.

Swing state Virginia is one of only two states electing governors this year. Neither Trump nor Obama endorsed in the New Jersey primaries on June 6, though former Vice President Joe Biden endorsed the eventual winner of the Democratic contest.

In the Virginia Republican primary, Corey Stewart was a one-time state Trump campaign chairman who has run as an unabashed supporter of the president and his policies. But he’s trailing a moderate Republican who has kept Trump at arm’s distance.

Democrat Tom Perriello lost his seat in Congress several years ago thanks in large part to his loyal support of Obama’s priorities. He later worked for the administration as a special State Department envoy. Now he’s in a tight race with the current lieutenant governor, playing catch-up both in time spent on the trail and money raised.

His more moderate rival, Ralph Northam, has the backing of the state party’s establishment and particularly robust support among black political leaders who feel a strong connection with the country’s first African-American president.

As a sign of just how important an Obama endorsement could be, Northam reached out to former Attorney General Eric Holder Jr. to make sure the former president knew of Northam’s “longstanding support,” said campaign spokesman David Turner.

Even without a direct endorsement, Perriello has leaned heavily on Obama’s past support in his current campaign. His first TV ad opened with footage from a 2010 rally where Obama praised Perriello.

He’s also pulled in endorsements from many of Obama’s former aides, including senior advisers like Valerie Jarrett and David Plouffe. Former Obama speechwriter Jon Lovett joined Perriello to pump up campaign canvassers recently in Northern Virginia, saying Perriello represented a needed new generation of Democratic leaders.

In an interview with The Associated Press, Perriello downplayed the lack of Obama’s direct support and said he’s excited with the level of help from the “extended Obama family.”

“We’ve gotten far more than we expected,” said Perriello, adding that “many people” feel that Obama has made his choice clear despite not making an endorsement.

Eric Schultz, a current senior adviser to Obama, said he doesn’t expect the former president to make an endorsement before the primary. But Schultz said Obama stands by the past comments he’s made praising Perriello.

The Republican primary appears to be less of a contest, with front-runner Ed Gillespie far outraising his competitors and leading in public polling. Gillespie, a former lobbyist and White House adviser to President George W. Bush, is almost Trump’s polar opposite in background and style.

Stewart, by contrast, likes to say he was “Trump before Trump was Trump” because of his blunt outspokenness and fierce opposition to illegal immigration.

But Stewart’s relationship with Trump is complicated by the fact that he was fired from the campaign after organizing a protest last year outside the Republican National Committee’s Washington headquarters. Stewart was upset that the RNC was not showing sufficient support for Trump after a leaked video showed him crudely bragging about grabbing women, though Trump aides felt Stewart was grandstanding for his own benefit.

Stewart said he never expected a Trump endorsement.

“I’d love to have his endorsement, but look, he’s got his own problems,” Stewart said. “President Trump likes people who are successful in their own right.”

A White House spokeswoman did not respond to a request for comment.