diff --git a/tempest/test.py b/tempest/test.py
index 59da2f9..68806c2 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -399,25 +399,6 @@
         cls.admin_client = os_admin.negative_client
 
     @staticmethod
-    def load_schema(file_or_dict):
-        """
-        Loads a schema from a file_or_dict on a specified location.
-
-        :param file_or_dict: just a dict or filename
-        """
-        # NOTE(mkoderer): we will get rid of this function when all test are
-        # ported to dicts
-        if isinstance(file_or_dict, dict):
-            return file_or_dict
-
-        # NOTE(mkoderer): must be extended for xml support
-        fn = os.path.join(
-            os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
-            "etc", "schemas", file_or_dict)
-        LOG.debug("Open schema file: %s" % (fn))
-        return json.load(open(fn))
-
-    @staticmethod
     def load_tests(*args):
         """
         Wrapper for testscenarios to set the mandatory scenarios variable
@@ -460,7 +441,6 @@
                 the data is used to generate query strings appended to the url,
                 otherwise for the body of the http call.
         """
-        description = NegativeAutoTest.load_schema(description)
         LOG.debug(description)
         generator = importutils.import_class(
             CONF.negative.test_generator)()
@@ -514,7 +494,6 @@
                 otherwise for the body of the http call.
 
         """
-        description = NegativeAutoTest.load_schema(description)
         LOG.info("Executing %s" % description["name"])
         LOG.debug(description)
         method = description["http-method"]
@@ -604,8 +583,6 @@
     """
     @attr(type=['negative', 'gate'])
     def generic_test(self):
-        if hasattr(self, '_schema_file'):
-            self.execute(self._schema_file)
         if hasattr(self, '_schema'):
             self.execute(self._schema)
 
diff --git a/tempest/tests/negative/test_negative_auto_test.py b/tempest/tests/negative/test_negative_auto_test.py
index edff3a8..dddd083 100644
--- a/tempest/tests/negative/test_negative_auto_test.py
+++ b/tempest/tests/negative/test_negative_auto_test.py
@@ -13,10 +13,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import json
-
-import mock
-
 from tempest import config
 import tempest.test as test
 from tempest.tests import base
@@ -58,11 +54,9 @@
         for entry in entries:
             self.assertIsNotNone(entry[1]['resource'])
 
-    @mock.patch('tempest.test.NegativeAutoTest.load_schema')
-    def test_generate_scenario(self, open_mock):
-        open_mock.return_value = self.fake_input_desc
+    def test_generate_scenario(self):
         scenarios = test.NegativeAutoTest.\
-            generate_scenario(None)
+            generate_scenario(self.fake_input_desc)
 
         self.assertIsInstance(scenarios, list)
         for scenario in scenarios:
@@ -72,13 +66,3 @@
         self._check_prop_entries(scenarios, "prop_minRam")
         self._check_prop_entries(scenarios, "prop_minDisk")
         self._check_resource_entries(scenarios, "inv_res")
-
-    def test_load_schema(self):
-        json_schema = json.dumps(self.fake_input_desc)
-        with mock.patch('tempest.test.open',
-                        mock.mock_open(read_data=json_schema),
-                        create=True):
-            return_file = test.NegativeAutoTest.load_schema('filename')
-            self.assertEqual(return_file, self.fake_input_desc)
-        return_dict = test.NegativeAutoTest.load_schema(self.fake_input_desc)
-        self.assertEqual(return_file, return_dict)
diff --git a/tempest/tests/test_decorators.py b/tempest/tests/test_decorators.py
index 6b678f7..12104ec 100644
--- a/tempest/tests/test_decorators.py
+++ b/tempest/tests/test_decorators.py
@@ -237,7 +237,7 @@
 class TestSimpleNegativeDecorator(BaseDecoratorsTest):
     @test.SimpleNegativeAutoTest
     class FakeNegativeJSONTest(test.NegativeAutoTest):
-        _schema_file = 'fake/schemas/file.json'
+        _schema = {}
 
     def test_testfunc_exist(self):
         self.assertIn("test_fake_negative", dir(self.FakeNegativeJSONTest))
@@ -247,4 +247,4 @@
         obj = self.FakeNegativeJSONTest("test_fake_negative")
         self.assertIn("test_fake_negative", dir(obj))
         obj.test_fake_negative()
-        mock.assert_called_once_with(self.FakeNegativeJSONTest._schema_file)
+        mock.assert_called_once_with(self.FakeNegativeJSONTest._schema)
