@@ -608,7 +608,7 @@ def test_prioritize_customer_dependencies_from_working_directory(self):
608
608
os .path .join (self ._customer_func_path , 'func_specific_module' )
609
609
)
610
610
611
- def test_reload_customer_libraries (self ):
611
+ def test_reload_customer_libraries_dependency_isolation_true (self ):
612
612
os .environ ['PYTHON_ISOLATE_WORKER_DEPENDENCIES' ] = 'true'
613
613
# Setup paths
614
614
DependencyManager .worker_deps_path = self ._worker_deps_path
@@ -621,6 +621,23 @@ def test_reload_customer_libraries(self):
621
621
common_module .package_location ,
622
622
os .path .join (self ._customer_deps_path , 'common_module' ))
623
623
624
+ def test_reload_customer_libraries_dependency_isolation_false (self ):
625
+ os .environ ['PYTHON_ISOLATE_WORKER_DEPENDENCIES' ] = 'false'
626
+ # Setup paths
627
+ DependencyManager .worker_deps_path = self ._worker_deps_path
628
+ DependencyManager .cx_deps_path = self ._customer_deps_path
629
+ DependencyManager .cx_working_dir = self ._customer_func_path
630
+
631
+ DependencyManager ._add_to_sys_path (self ._worker_deps_path , True )
632
+ import azure .functions # NoQA
633
+
634
+ DependencyManager ._add_to_sys_path (self ._customer_deps_path , True )
635
+ DependencyManager .reload_customer_libraries (self ._customer_deps_path )
636
+ # Checking if azure.functions gets reloaded
637
+ self .assertIn (
638
+ os .path .join (self ._customer_deps_path , 'azure' , 'functions' ),
639
+ sys .modules ['azure.functions' ].__path__ )
640
+
624
641
def test_remove_module_cache (self ):
625
642
# First import the common_module and create a sys.modules cache
626
643
sys .path .append (self ._customer_deps_path )
0 commit comments