The government’s stress tests for banks were similar to medical stress tests in one respect — it’s a great relief that they’re done.

Financial stocks rallied when the stress tests ended, which shows that those tests worsened the problem they were intended to repair. The tests introduced the idea that new regulation could be on the way, severely depressing bank-stock values during the first quarter — and thereby deflating bank capital.

Financial stocks in the S&P 500 fell by 11 percent on Feb. 10, the day Treasury Secretary Tim Geithner announced the scheme, and plummeted by 39 percent within a month. That wasn’t, as some claimed, because Geithner had been un clear. On the contrary, he was quite clear that the institutions that he deemed to need more capital would likely get “funds from the Treasury” from the Troubled Assets Relief Program, and that those funds would “come with conditions.”

Those conditions turned out to mean that the Treasury secretary might force banks to convert the government’s preferred shares into common stock, diluting earnings per share for private shareholders. That part of the plan naturally raised the market’s fears of partial nationalization — a potentially dangerous dose of the same poison that led to huge falls in the stock prices of AIG, Fannie Mae and Freddie Mac, companies that the government “bailed out” and of which it now owns large stakes.

Since early March, however, the government has backed off in ways that make it much less risky for private investors again to own shares in big banks and insurance companies. Greater reluctance to accept TARP funds, reduced demonizing of banks by politicians, gentler treatment by regulators and the growing implausibility of worst-case scenarios all combined to make the stress tests far less stressful than many expected three months ago. But the trip from there to here was a bumpy ride and quite unnecessary.

Despite the clumsy Treasury efforts of Feb. 10, several things went right since early March, when perennial bears were talking about the Dow falling to 5,000.

First, the added capital the stress tests require of the banks turns out to be little more than half of what some market analysts once expected it to be. Moreover, just a handful of banks need to raise this capital. Wells Fargo promptly eliminated more than half of what the stress test identified as the second-largest bank-capital deficit by selling $7.5 billion of new shares at a high price in a single day.

Second, in mid-March the Financial Accounting Standards Board relaxed the “mark-to-market” rules that might otherwise have compelled banks to treat hypothetical losses on unsold mortgage-backed securities as actual losses. So suddenly their balance sheets didn’t look so bad.

Third, many financial institutions announced plans to pay back TARP loans and/​or to shun future involvement in such meddlesome deals. The market invariably welcomes such independence.

On April 14, for example, The Wall Street Journal’s daily roundup noted that Genworth Financial’s stock had risen 17.8 percent in a single day because “the insurer said it won’t participate in the Treasury’s capital-purchase plan.” By not letting Treasury buy shares, Genworth suddenly had 17.8 percent more high-quality capital.

The stress tests were essentially a pretentious exercise in making arbitrary predictions about financial institutions using statistical measures of dubious relevance. How arbitrary? Well, the Federal Reserve originally thought Citigroup would need an extra $35 billion of capital to deal with any worst-case scenario, but Citigroup persuaded it at the last minute to drop that amount to $5 billion by arguing, in essence, that the Fed got the numbers all wrong. The Fed also assumed that Goldman Sachs would be more profitable in the future than its rival investment bank Morgan Stanley, and therefore able to tap earnings rather than capital in any crisis — but that’s guesswork, at best.

Indeed, the Fed’s extreme emphasis on the banks’ capitalization looks exaggerated, if not misplaced. Last year’s dramatic failures of Washington Mutual, Indy Mac, Bear Stearns, Fannie Mae and others were not caused by any identified shortage of capital. They were caused by a shortage of liquidity (cash), depositor runs and other factors.

The whole idea of an upredictable “stress test” scared the daylights out of investors under the pretext of reassuring them. The flight from financial stocks, in turn, aggravated the problems Secretary Geithner set out to fix.

Financial markets need rules that don’t change perpetually. It seems comforting, for the moment, that this latest episode of regulatory caprice is over. But that respite will last only if federal regulators learn to stop playing such risky games with other peoples’ investments and retirement accounts.