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

Trouble running doctest

Hello,

When i run python -m doctest dd_game.py in my console, i get a syntaxError: invalid syntax, with the carrot pointing to the end of the word doctest. I am wondering if this is because i am running the newest version of python? (i am currently using workspaces - python version 3.5.0). If so, what should i use instead?

Thanks!

Kathryn

2 Answers

Ryan S
Ryan S
27,276 Points

Hi Kathryn,

Your syntax looks correct and should work fine for Python 3.5.

Did you make sure to run it outside of the Python shell? Running it in the shell can cause the error you are receiving.

Thanks! That seems to have worked.

Same thing happened with me. I just ignored it so I hope someone answers with a good solution.