How can I mock the following?
import os from unittest import TestCase from unittest.mock import patch class A: VAR_A = os.environ.get("ABC") @classmethod def foo(cls): return cls.VAR_A @patch.dict(os.environ, {'ABC': 'abc'}) class Test_A(TestCase): def test_foo(self): self.assertEqual(A.foo(), 'abc') This VAR_A is not getting mocked. AssertionError: None != 'abc'