def test_before_and_after_once(self):
        def before_fn(*a):
            test_functions.test_list.append(1)

        def after_fn(*a):
            test_functions.test_list.append(3)

        with before_after(
                'before_after.tests.test_functions.sample_fn',
                before_fn=before_fn, after_fn=after_fn, once=True):
            test_functions.sample_fn(2)
            test_functions.sample_fn(4)

        self.assertEqual(test_functions.test_list, [1, 2, 3, 4])