[test] avoid using a deprecated feature of yams
authorPhilippe Pepiot <philippe.pepiot@logilab.fr>
Fri, 20 Jan 2017 09:55:08 +0100
changeset 11916 f0bc9ca93e21
parent 11915 fd42a39d3f66
child 11918 a88101bf9f87
[test] avoid using a deprecated feature of yams handle_file() now require a module name (yams@d9120d7)
cubicweb/test/unittest_schema.py
--- a/cubicweb/test/unittest_schema.py	Tue May 12 22:14:24 2015 +0200
+++ b/cubicweb/test/unittest_schema.py	Fri Jan 20 09:55:08 2017 +0100
@@ -17,7 +17,7 @@
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
 """unit tests for module cubicweb.schema"""
 
-from os.path import join, dirname
+from os.path import join, dirname, splitext
 
 from logilab.common.testlib import TestCase, unittest_main
 
@@ -402,7 +402,8 @@
         self.loader.post_build_callbacks = []
 
     def _test(self, schemafile, msg):
-        self.loader.handle_file(join(DATADIR, schemafile), None)
+        self.loader.handle_file(join(DATADIR, schemafile),
+                                splitext(schemafile)[0])
         sch = self.loader.schemacls('toto')
         with self.assertRaises(BadSchemaDefinition) as cm:
             fill_schema(sch, self.loader.defined, False)