writing yaml to disk needs bytes

Change-Id: Ica7f2e3ef9d5a491f3d1608186b478467c2eb2cf
diff --git a/tests/base.py b/tests/base.py
index c680389..5b3a79a 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -1928,7 +1928,7 @@
                     'source': {driver:
                                {'config-projects': ['common-config'],
                                 'untrusted-projects': untrusted_projects}}}}]
-        f.write(yaml.dump(config))
+        f.write(yaml.dump(config).encode('utf8'))
         f.close()
         self.config.set('zuul', 'tenant_config',
                         os.path.join(FIXTURE_DIR, f.name))