[Python-checkins] cpython: Rename test module names for #16421 to don't clash with other tests.
andrew.svetlov
python-checkins at python.org
Sat Dec 15 16:23:11 CET 2012
http://hg.python.org/cpython/rev/2e492a9a1845
changeset: 80855:2e492a9a1845
user: Andrew Svetlov <andrew.svetlov at gmail.com>
date: Sat Dec 15 17:22:59 2012 +0200
summary:
Rename test module names for #16421 to don't clash with other tests.
files:
Lib/test/test_imp.py | 8 ++++----
Modules/_testimportmultiple.c | 12 ++++++------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -223,11 +223,11 @@
fileobj, pathname, description = imp.find_module(m)
fileobj.close()
mod0 = imp.load_dynamic(m, pathname)
- mod1 = imp.load_dynamic('foo', pathname)
- mod2 = imp.load_dynamic('bar', pathname)
+ mod1 = imp.load_dynamic('_testimportmultiple_foo', pathname)
+ mod2 = imp.load_dynamic('_testimportmultiple_bar', pathname)
self.assertEqual(mod0.__name__, m)
- self.assertEqual(mod1.__name__, 'foo')
- self.assertEqual(mod2.__name__, 'bar')
+ self.assertEqual(mod1.__name__, '_testimportmultiple_foo')
+ self.assertEqual(mod2.__name__, '_testimportmultiple_bar')
with self.assertRaises(ImportError):
imp.load_dynamic('nonexistent', pathname)
diff --git a/Modules/_testimportmultiple.c b/Modules/_testimportmultiple.c
--- a/Modules/_testimportmultiple.c
+++ b/Modules/_testimportmultiple.c
@@ -24,8 +24,8 @@
static struct PyModuleDef _foomodule = {
PyModuleDef_HEAD_INIT,
- "foo",
- "foo doc",
+ "_testimportmultiple_foo",
+ "_testimportmultiple_foo doc",
-1,
NULL,
NULL,
@@ -34,15 +34,15 @@
NULL
};
-PyMODINIT_FUNC PyInit_foo()
+PyMODINIT_FUNC PyInit__testimportmultiple_foo()
{
return PyModule_Create(&_foomodule);
}
static struct PyModuleDef _barmodule = {
PyModuleDef_HEAD_INIT,
- "bar",
- "bar doc",
+ "_testimportmultiple_bar",
+ "_testimportmultiple_bar doc",
-1,
NULL,
NULL,
@@ -51,7 +51,7 @@
NULL
};
-PyMODINIT_FUNC PyInit_bar(){
+PyMODINIT_FUNC PyInit__testimportmultiple_bar(){
return PyModule_Create(&_barmodule);
}
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list