class HorizonMixin(object):

    def setUp(self):
        super(HorizonMixin, self).setUp()
        self.horizon = Horizon('https://localhost:8000', 'firefox')
        self.horizon.open_page_main()

    def tearDown(self):
        self.horizon.quit()
        super(HorizonMixin, self).tearDown()
def horizon():
    horizon = Horizon('http:/localhost:8000', 'firefox')
    horizon.open_page_main()
    yield horizon
    horizon.quit()