This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 8cb4bf324 feat(bindings/python): add OPENDAL_DISABLE_RANDOM_ROOT 
support (#3550)
8cb4bf324 is described below

commit 8cb4bf32427cf03f38c967c3c36012115b8032be
Author: Xiang Liao <[email protected]>
AuthorDate: Mon Nov 13 00:02:18 2023 +0800

    feat(bindings/python): add OPENDAL_DISABLE_RANDOM_ROOT support (#3550)
    
    * feat(bindings/Python): use GILProtected instead of Mutex
    
    * feat(bindings/Python): add OPENDAL_DISABLE_RANDOM_ROOT support
    
    * fix: delete unwanted change
    
    * fix: modify
    
    * fix: modify code according to suggestion
    
    * fix :use ruff to format
    
    * fix ci
---
 bindings/python/tests/conftest.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/bindings/python/tests/conftest.py 
b/bindings/python/tests/conftest.py
index 3385ee3f7..5e0f4ccfb 100644
--- a/bindings/python/tests/conftest.py
+++ b/bindings/python/tests/conftest.py
@@ -16,7 +16,7 @@
 # under the License.
 
 import os
-
+from uuid import uuid4
 import pytest
 from dotenv import load_dotenv
 
@@ -50,7 +50,11 @@ def setup_config(service_name):
     for key in os.environ.keys():
         if key.lower().startswith(prefix):
             config[key[len(prefix) :].lower()] = os.environ.get(key)
-
+    disable_random_root = (
+        True if os.environ.get("OPENDAL_DISABLE_RANDOM_ROOT") == "true" else 
False
+    )
+    if not disable_random_root:
+        config["root"] = f"{config.get('root', '/')}{str(uuid4())}/"
     return config
 
 

Reply via email to