diff --git a/tests/test_elements_worker/test_cli.py b/tests/test_elements_worker/test_cli.py
index f52978fdedad40c8335f7f74d60868e19d55f5bc..fa400b2e36657a5c3655fc2a99bc1f1a9e8ef50a 100644
--- a/tests/test_elements_worker/test_cli.py
+++ b/tests/test_elements_worker/test_cli.py
@@ -24,7 +24,7 @@ def test_cli_default(monkeypatch):
         )
     )
 
-    monkeypatch.setenv("TASK_ELEMENTS", path)
+    monkeypatch.setenv("TASK_ELEMENTS", str(path))
     monkeypatch.setattr(sys, "argv", ["worker"])
     worker = ElementsWorker()
     worker.configure()