PARIS—When history books are written on Europe in the early 21st century, this week may stand out. Pro-independence parties gained a majority in Catalonia’s regional elections, exacerbating a constitutional crisis in Spain. This occurred just days after Poland’s defiant right-wing government pushed back against the unprecedented threat of European Union sanctions by moving ahead with changes to the judiciary that European officials say threaten the rule of law.

All politics are local—until they’re not. The developments in Poland and Catalonia stem from unique circumstances, but each case tests the European Union from opposite sides, right in one case, and somewhat left in the other. What happens, as in the case of right-wing Poland (or Austria, which gave key Cabinet positions to the far right this week), when the will of the people goes against European values? And what happens when separatists who see themselves as progressives go against Spain’s constitution? How will Europe respond—or should it?

This week marked the first time the European Union took decisive action against Poland, where the government of President Andrzej Duda has a comfortable majority, controls the national media, and is intent on making key positions in the judiciary answer to the executive branch. At the same time, the country is the largest recipient of European Union funding in the 27-member bloc, slated to receive €100 billion in the current budget that runs through 2020. Will Brussels will put its money where its mouth is—or its mouth where its money is?

In Catalonia, a unionist party, Ciudadanos, led by the charismatic and conciliatory Inés Arrimadas, placed first in elections, and the unionist bloc got 43 percent of the vote, compared to 47 percent for the independistas, showing how divisive the issue remains. But Ciudadanos didn’t win enough seats to form a government. That’s up to Carles Puigdemont, the pro-separatist regional leader who fled to Belgium after Spanish authorities accused him of holding an illegal referendum on October 1. That referendum instigated a period of total confusion—Puigdemont declared independence, then maybe undeclared it—and Spanish Prime Minister Mariano Rajoy had called the elections to clarify things. Mostly they clarified that Rajoy’s government is weak. In a speech Friday, Rajoy seemed humbled, taking a somewhat softer tone than he had in recent weeks, when he had never even opened the door to conversation with the separatists. He said his government was open to dialogue with Catalan politicians—but within the framework of the rule of law.

That term, “rule of law,” keeps coming up in the EU’s various crises. And why not? The European Union was designed as a bulwark against nationalisms and autocracy, and in implementation concerns itself largely with minor questions of regulation—which is what makes this week’s test grand principles so unusual. The body theoretically operates in the service of lofty ideals, but in practice works at the level of micro-bureaucracy. In the middle are national governments.

Brexit looms in the background. When I was in Barcelona last month reporting on the independence movement, the independistas bristled at comparisons with Brexit. Catalan independistas were more progressive, more middle class, than the Brexiteers, they told me. They see themselves more as Scotland than England. They like Europe but don’t like Spain. In Poland, the governing Law and Justice party has taken pages from the Brexit playbook, mocking the European Union as a bunch of finger-wagging bureaucrats who want to flood Poland with waves of Muslim migrants. (In both Catalonia and Poland, leaders have turned historical grievances—and Catholicism—into a powerful political force.)

Other tectonic plates are shifting. Germany, once the most politically predictable country in Europe, has not yet formed a government, and Chancellor Angela Merkel is weaker than ever before. This week, an editorialist in Der Spiegel called for an end to the Merkel era—a position unthinkable months ago—saying her emphasis on stability was in fact causing more instability.

In France, President Emmanuel Macron’s six-month-old government is coming under pressure from right-wing critics who say the government hasn’t cracked down enough on illegal migrants, and from left-wing critics who say his handling of the crisis has been scandalously inhumane, with authorities busting up migrant encampments. More than 13,000 asylum-seekers are stuck on Greek islands, living in tents, Human Rights Watch reported. In Italy, younger voters who’ve come of age knowing only economic crisis are not convinced the European Union is doing them any favors.

But no countries are pushing further away from European values faster than Poland—and Hungary, where President Viktor Orban has promised to support Poland and block any sanctions that Europe might impose. (Whether that will happen remains to be seen. As part of its own double game with Europe, Hungary has pledged support for Poland in the past, then not followed through.)

After Duda said he would push ahead with the judicial changes in Poland, I asked Katarzyna Kasia, a philosophy professor at the Warsaw Academy of Fine Arts who’s been involved in anti-government protests, including by women fighting the government’s efforts to criminalize abortion, how the resistance was doing. “I feel that the hopelessness is constantly increasing,” she told me. But if Poland really pushed away from Europe, if Poles could no longer work or study across the bloc, then they might realize tangible meaning of the European project.

“I think Europe is going to be stronger now because it has no other choice,” Kasia told me. “It has to be stronger or fall apart. There’s no third way for the EU.”