-#=========================================================================
-# Export a shape into BREP
-#=========================================================================
- aRealVolume = 3.78827401738e-06
- testExport("BREP", "BREP", os.path.join(os.getcwd(), "Data", "screw_export.brep"), aRealVolume, 10 ** -17)
- testExport("BRP", "BREP", os.path.join(os.getcwd(), "Data", "screw_export.brp"), aRealVolume, 10 ** -17)
-#=========================================================================
-# Export a shape into STEP
-#=========================================================================
- testExport("STEP", "STEP", os.path.join(os.getcwd(), "Data", "screw_export.step"), 3.78825807533e-06, 10 ** -17)
- testExport("STP", "STEP", os.path.join(os.getcwd(), "Data", "screw_export.stp"), 3.78825807533e-06, 10 ** -17)
-#=========================================================================
-# Export a shape into IGES
-#=========================================================================
- testExport("IGES-5.1", "IGES-5.1", os.path.join(os.getcwd(), "Data", "screw_export-5.1.iges"), 3.78829613776e-06, 10 ** -17)
- testExport("IGS-5.1", "IGES-5.1", os.path.join(os.getcwd(), "Data", "screw_export-5.1.igs"), 3.78829613776e-06, 10 ** -17)
- testExport("IGES-5.3", "IGES-5.3", os.path.join(os.getcwd(), "Data", "screw_export-5.3.iges"), 3.78827401651e-06, 10 ** -17)
- testExport("IGS-5.3", "IGES-5.3", os.path.join(os.getcwd(), "Data", "screw_export-5.3.igs"), 3.78827401651e-06, 10 ** -17)
-#=========================================================================
-# Export a shape into XAO
-#=========================================================================
- testExportXAO()
-#=========================================================================
-# End of test
-#=========================================================================
-
-assert(model.checkPythonDump())
+ with TemporaryDirectory() as tmp_dir:
+ #=========================================================================
+ # Export a shape into BREP
+ #=========================================================================
+ aRealVolume = 3.78827401738e-06
+ testExport("BREP", "BREP", os.path.join(tmp_dir, "screw_export.brep"), aRealVolume, 10 ** -17)
+ testExport("BRP", "BREP", os.path.join(tmp_dir, "screw_export.brp"), aRealVolume, 10 ** -17)
+ #=========================================================================
+ # Export a shape into STEP
+ #=========================================================================
+ testExport("STEP", "STEP", os.path.join(tmp_dir, "screw_export.step"), 3.78825807533e-06, 10 ** -17)
+ testExport("STP", "STEP", os.path.join(tmp_dir, "screw_export.stp"), 3.78825807533e-06, 10 ** -17)
+ #=========================================================================
+ # Export a shape into IGES
+ #=========================================================================
+ testExport("IGES-5.1", "IGES-5.1", os.path.join(tmp_dir, "screw_export-5.1.iges"), 3.78829613776e-06, 10 ** -17)
+ testExport("IGS-5.1", "IGES-5.1", os.path.join(tmp_dir, "screw_export-5.1.igs"), 3.78829613776e-06, 10 ** -17)
+ testExport("IGES-5.3", "IGES-5.3", os.path.join(tmp_dir, "screw_export-5.3.iges"), 3.78827401651e-06, 10 ** -17)
+ testExport("IGS-5.3", "IGES-5.3", os.path.join(tmp_dir, "screw_export-5.3.igs"), 3.78827401651e-06, 10 ** -17)
+ #=========================================================================
+ # Export a shape into XAO
+ #=========================================================================
+ testExportXAO(os.path.join(tmp_dir, "export.xao"))
+ #=========================================================================
+ # End of test
+ #=========================================================================
+
+ assert(model.checkPythonDump())