XMLSchemaContext instances have no iter() method,
but their property .root does.

Index: python-xmlschema/xmlschema/testing/_builders.py
===================================================================
--- python-xmlschema.orig/xmlschema/testing/_builders.py
+++ python-xmlschema/xmlschema/testing/_builders.py
@@ -126,7 +126,7 @@ def make_schema_test_class(test_file, te
             if not inspect and not self.errors:
                 context = XMLSchemaContext(schema)
                 elements = [x for x in schema.iter()]  # Contains schema elements only
-                xpath_context_elements = [x for x in context.iter() if isinstance(x, XsdValidator)]
+                xpath_context_elements = [x for x in context.root.iter() if isinstance(x, XsdValidator)]
                 descendants = [x for x in context.iter_descendants('descendant-or-self')]
                 self.assertTrue(x in descendants for x in xpath_context_elements)
                 for e in elements:
