The issue (aside from indentation) is that your test function doesn't start with test. Using the unittest (docs) module requires that naming.
import unittest
class TestStringMethods(unittest.TestCase):
def test_upper(self):
self.assertEqual('foo'.upper(), 'FOO')
def this_is_not_a_test(self):
print("doesn't start with 'test'")
From the "Basic Example" documentation:
A testcase is created by subclassing unittest.TestCase. The three individual tests are defined with methods whose names start with the letters test. This naming convention informs the test runner about which methods represent tests.
TestCaseDemoclass. Just adjust your indentation.