Polls have closed in the by-elections being held in Wakefield and Tiverton and Honiton.
Both seats were held by the Conservatives before their previous MPs resigned in disgrace, triggering the by-elections.
Results are expected to be announced overnight.
Asked whether he would consider his position if he lost both by-elections, the prime minister said: “I’m going to be watching the results with interest.”
While “always full of optimism and buoyancy”, the PM cautioned: “I think most seasoned political observers such as yourself know that by-elections in midterm are never necessarily easy for any government.”
In Wakefield, West Yorkshire, ex-Conservative MP Imran Ahmad Khan stood down after being found guilty of sexually assaulting a 15-year-old boy and being jailed for 18 months.
Once one of the so-called Red Wall seats, it was won by the Tories in the 2019 general election, though Labour is now hoping to take it back.
In Tiverton and Honiton, Devon, Neil Parish resigned after admitting he had watched pornography twice on his phone in the House of Commons.
The Liberal Democrats have their sights set on the constituency and would need to overturn a Conservative majority of 24,239.
If the Conservatives lose both by-elections, it would be only the seventh time a government has suffered a double defeat since the Second World War.