def test_mangling(self):

    class A():

        def f():
            __mangled = 1
            __not_mangled__ = 2
            import __mangled_mod
            import __package__.module
    self.assertIn('_A__mangled', A.f.__code__.co_varnames)
    self.assertIn('__not_mangled__', A.f.__code__.co_varnames)
    self.assertIn('_A__mangled_mod', A.f.__code__.co_varnames)
    self.assertIn('__package__', A.f.__code__.co_varnames)
def test_mangling(self):

    class A():

        def f():
            __mangled = 1
            __not_mangled__ = 2
            import __mangled_mod
            import __package__.module
    self.assertIn('_A__mangled', A.f.__code__.co_varnames)
    self.assertIn('__not_mangled__', A.f.__code__.co_varnames)
    self.assertIn('_A__mangled_mod', A.f.__code__.co_varnames)
    self.assertIn('__package__', A.f.__code__.co_varnames)