class BaseTestCase(unittest.TestCase):
    my_dict = {'hello': 'world'}


class TestCase1(BaseTestCase):

    def test_my_dict_key(self):
        self.assertTrue('hello' in self.my_dict)


class TestCase2(BaseTestCase):

    def test_my_dict_value(self):
        self.assertTrue('world' in list(self.my_dict.values()))
how to share a variable across modules for all tests in py.test