From 59892b853236fdcbf4b2cfca4eada803896ff92f Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 29 Aug 2009 15:14:18 -0500 Subject: [PATCH] remove usage of the new module --HG-- branch : trunk --- py/path/local.py | 2 +- py/test/testing/test_pluginmanager.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/py/path/local.py b/py/path/local.py index b9edf3c5c..c464abeba 100644 --- a/py/path/local.py +++ b/py/path/local.py @@ -531,7 +531,7 @@ class LocalPath(FSBase): return sys.modules[modname] except KeyError: # we have a custom modname, do a pseudo-import - mod = py.std.new.module(modname) + mod = py.std.types.ModuleType(modname) mod.__file__ = str(self) sys.modules[modname] = mod try: diff --git a/py/test/testing/test_pluginmanager.py b/py/test/testing/test_pluginmanager.py index 4f321996a..f180ba0c3 100644 --- a/py/test/testing/test_pluginmanager.py +++ b/py/test/testing/test_pluginmanager.py @@ -78,14 +78,14 @@ class TestBootstrapping: testdir.syspathinsert() testdir.makepyfile(pytest_plug1="#") testdir.makepyfile(pytest_plug2="#") - mod = py.std.new.module("temp") + mod = py.std.types.ModuleType("temp") mod.pytest_plugins = ["pytest_plug1", "pytest_plug2"] pluginmanager.consider_module(mod) assert pluginmanager.getplugin("plug1").__name__ == "pytest_plug1" assert pluginmanager.getplugin("plug2").__name__ == "pytest_plug2" def test_consider_module_import_module(self, testdir): - mod = py.std.new.module("x") + mod = py.std.types.ModuleType("x") mod.pytest_plugins = "pytest_a" aplugin = testdir.makepyfile(pytest_a="#") pluginmanager = PluginManager() @@ -131,12 +131,12 @@ class TestBootstrapping: def test_register_imported_modules(self): pp = PluginManager() - mod = py.std.new.module("x.y.pytest_hello") + mod = py.std.types.ModuleType("x.y.pytest_hello") pp.register(mod) assert pp.isregistered(mod) assert pp.getplugins() == [mod] py.test.raises(AssertionError, "pp.register(mod)") - mod2 = py.std.new.module("pytest_hello") + mod2 = py.std.types.ModuleType("pytest_hello") #pp.register(mod2) # double registry py.test.raises(AssertionError, "pp.register(mod)") #assert not pp.isregistered(mod2)