diff --git a/qupsy/spec.py b/qupsy/spec.py
index c4e769e..3109e6b 100644
--- a/qupsy/spec.py
+++ b/qupsy/spec.py
@@ -37,12 +37,15 @@ def __str__(self) -> str:
             testcases_string.append(
                 f"        ( Input: {input_str},\n         Output: {output_str}),"
             )
-        return f"""Spec(
-    gates: [{", ".join(map(lambda g: g.__name__, self.gates))}],
+        return """Spec(
+    gates: [{}],
     testcases: [
-{"\n".join(testcases_string)}
+{}
     ],
-)"""
+)""".format(
+            ", ".join(map(lambda g: g.__name__, self.gates)),
+            "\n".join(testcases_string),
+        )
 
 
 def make_spec(data: SpecData) -> Spec: