I believe this is The Shadow of What was Lost by James Islington; book 1 of The Licanius Trilogy.
There was a magical war that happened in the past. Something to do with different sectors or something like that.
20 years before the events of the book, there was a war between the "Gifted" (magic users) and non-gifted. The Augurs (different magic users who ruled) were killed off and the Gifted were put under a treaty which greatly limited their use of the powers. Everyone with access to the power gains a "mark"; essentially a magical tattoo.
Then the book focuses on a teenage boy that is currently at a magic school, which is protected from outsiders.
The main character, Davian, lives in a "Tol" which is essentially a magic school. There are two remaining Tols; which may be the sectors you were thinking of.
There is this magic test that happens (which sees what magic abilities the students are capable of), but this boy does not have any magic.
There is a test coming up where Davian has to show proficiency with the Gift. If they fail, they are turned into "Shadows"; which removes access to the power and leaves black lines all over their skin. The shadows are treated even worse than the Gifted, who are already ostracized. Davian has been unable to use the gift properly ever since he got the mark.
He has told his friend about this who so far has helped him in covering up that he is not magical.
His friend Wirr (or Asha?) both know that he struggles to use the power, and so they try to comfort him. They also know about an ability that he has, but they don't share it with anyone. That is likely what you are thinking about covering up. Everyone in the Tol knows Davian will fail the test.
Then I remember the boy leaving the school to go to the market and meets a man. They end up going somewhere together.
Davian has to go into the town to buy stuff for the Tol. He is attacked by some people for being a "bleeder" (Gifted). He is only saved last minute by an elder from the other Tol (Ilseth Tenvar). Ilseth goes back to the Tol with Davian to make sure he is not attacked again.
Also, in the title you mention that he leaves the school. This happens after meeting Ilseth Tenvar, who tells him that he needs to leave the school and head north because (spoilers for a few chapters in)
he is actually an Augur, and needs to go check on the magic boundary in the north that keeps the evil forces away.
The final book in the trilogy was just recently released, and I highly recommend this series. It's one of my favourite series I've read.