← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~pappacena/turnip:py3-celery-fixture-fix into turnip:master

 

Thiago F. Pappacena has proposed merging ~pappacena/turnip:py3-celery-fixture-fix into turnip:master.

Commit message:
Better conversion of config types when starting fixture celery

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pappacena/turnip/+git/turnip/+merge/393761
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/turnip:py3-celery-fixture-fix into turnip:master.
diff --git a/turnip/tests/tasks.py b/turnip/tests/tasks.py
index 39dced8..01845ec 100644
--- a/turnip/tests/tasks.py
+++ b/turnip/tests/tasks.py
@@ -9,6 +9,7 @@ import sys
 import time
 
 import fixtures
+import six
 
 from turnip.config import config
 from turnip.tasks import app
@@ -67,7 +68,12 @@ class CeleryWorkerFixture(fixtures.Fixture):
         # are currently using.
         proc_env = {}
         for k in config.defaults:
-            proc_env[k.upper()] = str(config.get(k))
+            value = config.get(k)
+            if isinstance(value, six.binary_type):
+                value = value.decode("utf-8")
+            else:
+                value = six.text_type(value)
+            proc_env[k.upper()] = value
         proc_env.update(self.env or {})
 
         CeleryWorkerFixture._worker_proc = subprocess.Popen(cmd, env=proc_env)