Thanks to the 0.41.2 for Android and 1.11.2 for iOS update, you can now assemble your best Pokemon to train in your team gym. Before, you could only take on your gym with just one Pokemon. Unless the chosen Pokemon was a monster like no other or the gym was protected by low-CP Pokemon, there was no way you were going to beat the gym with just one.
Now training works just like battling rival gyms. You can form a team of six go up against your fellow teammates, making it much easier to beat the entire gym.
How does the new training work?
Training with your six is just like battling an opposing team. Tapping on a gym will bring up the option to battle. Start the battle by tapping on the glove icon in the bottom right-hand corner. Then, the game will suggest six Pokemon to use in the training battle. If you don't like the picks, tap on the Pokemon you want to change and choose a new one from the list.
Pro tip: Before you choose your team, scroll through the Pokemon in your gym and take note of their CP and type. Then, choose your six. For example, if the first Pokemon is a 1,300 CP Vaporeon, choose an electric type with a similar or higher CP as your first Pokemon.
Once you're satisfied with your lineup, tap the Go button at the bottom right side of the screen and battle as usual.
What does training affect?
Though some people have speculated that Pokemon will be able level up when new training features are introduced, it hasn't happened with this update. When you beat a gym you only get XP and gym prestige.
Just as a test, I took note of the CP and stats of my Pokemon. Then, I went to my local team gym, battled and beat the it. The CP and stats did not change for my Pokemon, no matter how many times I beat the gym.
Does Niantic give you a fair fight?
In the update notes for the 0.41.2 for Android and 1.11.2 for iOS update, Niantic says, "The CP of the Pokémon you are battling may be temporarily adjusted lower for your training session." This would be a great feature for new trainers with low CP Pokemon since most gyms are guarded by Pokemon with very high CPs.
As a I entered the gym and started to battle, the CP of the Pokemon didn't adjust for me at all. I tried this several times and I never noticed an adjustment. Of course, Niantic said "may be temporarily adjusted," so I guess there's no guarantee of a fairer fight.