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 Covering Your Bases Using Coverage

Is there a small mistake in video?

Hi, Kenneth Love

As usual, awesome video... definitely enjoying the teaching!

This is a small thing, but it looks like the test_creation method has "range(1, 6)" on 3:51 of the video. (I'm guessing that this is the reason why you got that error right after running the coverage module a few seconds later... the test happened to rolled a "6" and 6 wasn't included in your range.)

The Workspaces file for this video shows "range(1, 7)" so there's no issue there. Hope this helps! D.

2 Answers

Joshua Hovden
Joshua Hovden
3,299 Points

This was an illuminating example, too, for me. I wasn't sure whether python generated multiple/an exhaustive list of instances of the class and tested each one or created just one instance and tested the latter. It seems like it's the latter, since the test only failed once.