Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Testing First Steps With Testing Writing and Running Doctests

Trung Tran
Trung Tran
1,440 Points

Test for get_moves(player) doesn't seem right

Please let me know if there is a hole in my logic, but the way you write test for get_moves(player) seem like a paradox to me: You write test to check if the function works as you expect. So what you write should be your expected output of the function right? But instead you just run the function and copy its output into your test. Then ofcourse the test can't fail. It's like trying to score a student's test, but using his own answers as the "correct answers" reference. Then ofcourse he'll get 10/10?

1 Answer

Yuyang Peng
Yuyang Peng
5,665 Points

Yeah I had the same thought, but to think there shouldn't be any errors because Treehouse uses this for education. That was just Kenneth being lazy I guess.