From 8cdb1289cf97c48e8fbdc597dd55d6e536768cea Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 8 Nov 2021 19:39:35 +0300 Subject: [PATCH] bos #26609 Patching tests (Windows) --- src/ExchangePlugin/Test/TestImportImage_1.py | 5 +++-- src/ExchangePlugin/Test/TestImportImage_2.py | 5 +++-- src/ExchangePlugin/Test/testme.py | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ExchangePlugin/Test/TestImportImage_1.py b/src/ExchangePlugin/Test/TestImportImage_1.py index 1c529e196..1fcc4645b 100755 --- a/src/ExchangePlugin/Test/TestImportImage_1.py +++ b/src/ExchangePlugin/Test/TestImportImage_1.py @@ -99,6 +99,7 @@ assert(abs(dz-0) <= tol) # Close SALOME GUI import salome_utils -import subprocess +import killSalomeWithPort + port = salome_utils.getPortNumber() -proc = subprocess.Popen(["killSalomeWithPort.py", "{}".format(port)]) +killSalomeWithPort.killMyPort(port) diff --git a/src/ExchangePlugin/Test/TestImportImage_2.py b/src/ExchangePlugin/Test/TestImportImage_2.py index 94b328fb3..7f26b06b2 100755 --- a/src/ExchangePlugin/Test/TestImportImage_2.py +++ b/src/ExchangePlugin/Test/TestImportImage_2.py @@ -105,6 +105,7 @@ assert(abs(dz-0) <= tol) # Close SALOME GUI import salome_utils -import subprocess +import killSalomeWithPort + port = salome_utils.getPortNumber() -proc = subprocess.Popen(["killSalomeWithPort.py", "{}".format(port)]) +killSalomeWithPort.killMyPort(port) diff --git a/src/ExchangePlugin/Test/testme.py b/src/ExchangePlugin/Test/testme.py index 94e8622d6..99f241f65 100755 --- a/src/ExchangePlugin/Test/testme.py +++ b/src/ExchangePlugin/Test/testme.py @@ -62,7 +62,8 @@ class SalomeSession(object): def __del__(self): port = os.getenv('NSPORT') import killSalomeWithPort - killSalomeWithPort.killMyPort(port) + if port: + killSalomeWithPort.killMyPort(port) return pass -- 2.39.2