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 Simple Unit Test

Denis Ts
Denis Ts
2,751 Points

HI Please advise what can be wrong with this code. Im getting "Task 1 no longer passed"

import unittest

class SimpleTestCase(unittest.TsetCase): def test_one(self): asserts 10 - 10 == 0

tests.py
import unittest

class SimpleTestCase(unittest.TsetCase):
    def test_one(self):
        asserts 10 - 10 == 0

3 Answers

You said asserts instead of assert.

:point_right: Replace your code inside of the test_one function with this code:

assert 10 - 10 == 0

As you see, Python is very picky even if you make a typo. To Python asserts is very different from assert. Python will think asserts is a variable since it isn't a keyword :)

I hope you understand. :smile:

Good luck! ~Alex

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

In addition to Alexander,

You also have a typing error in the parameters for the class. You have unittest.TsetCase instead of unittest.TestCase.

:dizzy:

Oh whoops I always miss those kind of things XD

Thanks for catching that :smile:

~Alex

Denis Ts
Denis Ts
2,751 Points

Thank you Alex and Jason!!! it was just typo :(

Can you provide either of us with a Best answer? It helps with the Community filtering system :)

The button is located right below any post.

Thank you for improving the community! ~Alex