Every single class has a spy-checking method other than beating them senseless.
Scout: Mad Milk will cover a spy in milk Flying Guillotine causes spies to bleed Boston Basher makes causes spies to bleed Sandman will stun enemy spies
Soldier: Rockets will explode if you hit a disguised spy, while rockets on normal allies will pass through them Buff Banners will not buff teammates if it's a spy Hitting a spy with the Disciplinary Action will not give you a speed boost
Pyro: Flamethrowers, Flare Guns, and the Sharpened Volcano Fragment will ignite a spy on hit Airblasts will knock them back
Demoman: Grenades will explode if you hit a disguised spy, while grenades on normal allies will pass through them Ullapool Caber will explode if you hit a disguised spy, while it doesn't on normal allies Shields will stop when you charge into one
Heavy: Huo-Long Heater can ignite enemy spies A disguised spy eating a Sandvich you drop for them at "full health" is a give-away
Engineer: Southern Hospitality causes spies to bleed Pomson 6000 makes a distinct sound when you hit a disguised spy
Medic: Shooting a "hurt" disguised spy with the Crusader's Crossbow will instead make an impaling sound instead of healing them If you manage to heal a Soldier holding the Equalizer or Escape Plan, it's a disguised spy Healing with the Amputator will not cause the particle effect or heal disguised spies
Sniper: Jarate reveals disguised spies Tribalman's Shiv causes spies to bleed Huntsman will make an impaling sound on a disguised spy hit
Spy: If your knife raises when you go behind a disguised spy, he's a spy
And the last one...
Simply bumping into a disguised spy will cause you to collide with them instead of passing through
Go in adv opshons and enable console commands when done press the button to the left of number one on your key board that is console commands when you or playing OFFLINE type in buddha in console commands and that will give INFINATE HEALTH !!!
Soldiers and Demomen can help Medics gain an Ubercharge quicker than normal by blowing up on themselves with rockets/stickybombs respectively. Medics get a faster Ubercharge fill rate when healing harmed players.
Two ways to find out if there is a spy easily is to a) set him on fire with a Pyro's Flamethrower or b) hit him with Jarate from a Sniper. He will then be walking around with the aftereffects on him.
Sure signs of a spy:
Pyros on fire are a sure sign of a spy. Scouts going slower than their normal speed are a sure sign of a spy. Not being able to pass through your teammate is a sure sign of a spy. Engineers standing by sapped buildings with shotguns, not breaking the saps, is a sure sign of a spy. A Sniper's laser dot's size slightly increasing while going over a "clear" area is a sure sign of a cloaked spy. (Note: This is not very noticeable unless you are in a small tunnel or something ike that.) "Friendly" Spies not flashing your team color when cloaking are a sure sign of a spy. Demoman grenades exploding on nothing is a sure sign of a spy. Soldier rocets exploding on nothing is a sure sign of a spy. Someone with exactly 50% health. Someone with your name. Someone that is a class not on your team.
Possible signs of a spy:
A Pyro in water. A Medic not healing teammates. Someone walking backwards into your base while calling for a medic. An offensive class (Scout, Soldier, Pyro, Heavy) not shooting at all.
Signs someone is NOT a spy:
Being able to walk through that person. Bullets, grenades, rockets, etc. From your teammates go through that person. Spy with a cardboard mask on his face. If your crosshairs go over this person, it should say "Disguised as enemy [class]". Shooting at enemies.