diff -r f03151638ae7 jython/Lib/test/test_class.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jython/Lib/test/test_class.py Mon Sep 24 20:34:17 2007 -0400 @@ -0,0 +1,14 @@ +import unittest +from test import test_support + +class ClassAttributesTestCase(unittest.TestCase): + def test_module_attribute(self): + #Test for SF bug #1781500: wrong __module__ for classes with a metaclass + from test_class_support.simpleclass import TestClass + self.assert_(TestClass.__module__.endswith('simpleclass')) + +def test_main(): + test_support.run_unittest(ClassAttributesTestCase) + +if __name__ == '__main__': + test_main() diff -r f03151638ae7 jython/Lib/test/test_class_support/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jython/Lib/test/test_class_support/__init__.py Mon Sep 24 20:34:17 2007 -0400 @@ -0,0 +1,1 @@ +# Support files for test.test_class diff -r f03151638ae7 jython/Lib/test/test_class_support/metaclass.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jython/Lib/test/test_class_support/metaclass.py Mon Sep 24 20:34:17 2007 -0400 @@ -0,0 +1,5 @@ +class NoOpMetaClass(type): + "A no-op meta class, useful for testing the SF bug #1781500" + def __new__(cls, name, bases, attrs): + r = type.__new__(cls, name, bases, attrs) + return r diff -r f03151638ae7 jython/Lib/test/test_class_support/simpleclass.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jython/Lib/test/test_class_support/simpleclass.py Mon Sep 24 20:34:17 2007 -0400 @@ -0,0 +1,4 @@ +from metaclass import NoOpMetaClass +class TestClass(object): + __metaclass__ = NoOpMetaClass +