Salome HOME
[Intersect2D] Keep flexibility on orientation of mesh2
[tools/medcoupling.git] / src / PyWrapping / TestPyWrapGathered_medcoupling.py
index 79a2b6d18ca9a92dbbee5ecfad6ece73086091ed..8f239edc145ee8b94c757ae37eaf39af9d8571bc 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2017  CEA/DEN, EDF R&D
+# Copyright (C) 2017-2021  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # Author : Anthony Geay (EDF R&D)
 
 from medcoupling import *
+
 import unittest
 
+def WriteInTmpDir(func):
+    def decoratedFunc(*args,**kwargs):
+        import tempfile,os
+        ret = None
+        with tempfile.TemporaryDirectory() as tmpdirname:
+            os.chdir(tmpdirname)
+            ret = func(*args,**kwargs)
+            pass
+        return ret
+    return decoratedFunc
+
 class FileCreator(object):
     def __init__(self,tester,fname):
         self._tester=tester
@@ -59,6 +71,7 @@ class medcouplingTest(unittest.TestCase):
         pass
     
     @unittest.skipUnless(HasMEDFileExt(),"Requires link to MED file")
+    @WriteInTmpDir
     def test1(self):
         import sys
         fname="mctest1.med"