File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -218,6 +218,14 @@ def __init__(self):
218218 if "PYTHONPATH" in os .environ :
219219 self .oldpythonpath = os .environ ["PYTHONPATH" ]
220220
221+ # Set environment variables for use by `run_external`
222+ # from equinor/equilibrium:
223+ if "PYTHONPATH" in os .environ :
224+ os .environ ["_PRE_RMS_PYTHONPATH" ] = os .environ ["PYTHONPATH" ]
225+ else :
226+ os .environ ["_PRE_RMS_PYTHONPATH" ] = ""
227+ os .environ ["_PRE_RMS_BACKUP" ] = "1"
228+
221229 print (
222230 _BColors .BOLD ,
223231 "\n Running <{0}>. Type <{0} -h> for help\n " .format (THISSCRIPT ),
@@ -500,7 +508,7 @@ def get_pythonpath(self):
500508 )
501509
502510 def launch_rms (self , empty = False ):
503- """Lauch RMS with correct pythonpath"""
511+ """Launch RMS with correct pythonpath"""
504512
505513 if self .exe is None :
506514 self .exe = "rms -v " + self .version_requested
Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ def test_do_parse_args(tmpdir):
4141 assert "dryrun=True" in str (runner .args )
4242
4343
44+ def test_backuppythonpath ():
45+ rr .RunRMS ()
46+ assert "_PRE_RMS_BACKUP" in os .environ
47+ assert "_PRE_RMS_PYTHONPATH" in os .environ
48+
49+
4450@pytest .mark .integration
4551def test_integration ():
4652 """Test that the endpoint is installed"""
You can’t perform that action at this time.
0 commit comments