Ronny Pfannschmidt avatar Ronny Pfannschmidt committed c163514 Merge

merge again

Comments (0)

Files changed (5)

-1.2.dev
+1.3.dev
+----------------------------------------
+
+- fix issue2 - adapt tests on Jython
+
+1.2
 ----------------------------------------
 
 - Allow to import from Aliasmodules  (thanks Ralf Schmitt)
 import sys
 from types import ModuleType
 
-__version__ = '1.2.dev7'
+__version__ = '1.3.dev'
 
 def initpkg(pkgname, exportdefs, attr=dict()):
     """ initialize given package from the export definitions. """
         description=
         'apipkg: namespace control and lazy-import mechanism',
         long_description = open('README.txt').read(),
-        version='1.2.dev7',
+        version='1.3.dev',
         url='http://bitbucket.org/hpk42/apipkg',
         license='MIT License',
         platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
     )
 
 if __name__ == '__main__':
-    main()
+    main()
 #
 # test support for importing modules
 #
+ModuleType = py.std.types.ModuleType
 
 class TestRealModule:
 
     return ns
 
 def test_initpkg_replaces_sysmodules(monkeypatch):
-    mod = type(sys)('hello')
+    mod = ModuleType('hello')
     monkeypatch.setitem(sys.modules, 'hello', mod)
     apipkg.initpkg('hello', {'x': 'os.path:abspath'})
     newmod = sys.modules['hello']
     assert newmod.x == py.std.os.path.abspath
 
 def test_initpkg_transfers_attrs(monkeypatch):
-    mod = type(sys)('hello')
+    mod = ModuleType('hello')
     mod.__version__ = 10
     mod.__file__ = "hello.py"
     mod.__loader__ = "loader"
     assert newmod.__doc__ == mod.__doc__
 
 def test_initpkg_nodoc(monkeypatch):
-    mod = type(sys)('hello')
+    mod = ModuleType('hello')
     mod.__file__ = "hello.py"
     monkeypatch.setitem(sys.modules, 'hello', mod)
     apipkg.initpkg('hello', {})
     assert not newmod.__doc__
 
 def test_initpkg_overwrite_doc(monkeypatch):
-    hello = type(sys)('hello')
+    hello = ModuleType('hello')
     hello.__doc__ = "this is the documentation"
     monkeypatch.setitem(sys.modules, 'hello', hello)
     apipkg.initpkg('hello', {"__doc__": "sys:__doc__"})
     assert newhello.__doc__ == sys.__doc__
 
 def test_initpkg_not_transfers_not_existing_attrs(monkeypatch):
-    mod = type(sys)('hello')
+    mod = ModuleType('hello')
     mod.__file__ = "hello.py"
     monkeypatch.setitem(sys.modules, 'hello', mod)
     apipkg.initpkg('hello', {})
     assert not hasattr(newmod, '__path__')
 
 def test_initpkg_defaults(monkeypatch):
-    mod = type(sys)('hello')
+    mod = ModuleType('hello')
     monkeypatch.setitem(sys.modules, 'hello', mod)
     apipkg.initpkg('hello', {})
     newmod = sys.modules['hello']
 
 [testenv]
 commands=py.test --junitxml={envlogdir}/junit-{envname}.xml []
-deps= py
+deps=pytest
+
+[testenv:jython]
+commands=py.test-jython --junitxml={envlogdir}/junit-{envname}.xml []
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.