I agree with those who stated above that you should ask PRIOR to taking the class if you need to purchase materials there. I worked in a LYS and most are small business owners who are trying to make a living just like everyone else. The amount of help provided in most classes far outweighs the cost being charged to students. So in the end, the profit is made by the purchase of materials.
Check out websites for LYS around the country and you'll see the norm is that materials are to be purchased at the store.
The above being stated, I understand that knitting can be a very expensive hobby. Perhaps you should consider taking classes at your local craft store (Micheals, AC Moore, Hobby Lobby) or through Community Education in your area. You'll most likely be paying much less than at the LYS and you'll have the option to either bring in your own yarn or purchase more moderate priced yarns.
Hope none of this comes off too strong, but having worked in a LYS I have an understanding for skyrocketing rents, minimum yarn orders, and trying to provid quality customer service piled on top of trying to make a living.