Test: Do not write test files into CWD

When running the tests make sure to write the test files into the temp directory.

This fixes issue 19112
This commit is contained in:
wmayer
2025-01-24 15:38:09 +01:00
committed by Kacper Donat
parent fde5ad9af6
commit 2c2ebc6ed2
2 changed files with 8 additions and 5 deletions

View File

@@ -23,8 +23,10 @@
""" Tests related to the Topological Naming Problem """
import os
import math
import unittest
import tempfile
import FreeCAD as App
import Part
@@ -2484,10 +2486,10 @@ class TestTopologicalNamingProblem(unittest.TestCase):
self.Body = self.Doc.addObject("PartDesign::Body", "Body")
self.create_t_sketch()
self.assertEqual(self.Doc.Sketch.Shape.ElementMapSize, 18)
filename = self.Doc.Name
filename = tempfile.gettempdir() + os.sep + self.Doc.Name
# Act
self.Doc.saveAs(filename)
App.closeDocument(filename)
App.closeDocument(self.Doc.Name)
self.Doc = App.openDocument(filename + ".FCStd")
self.Doc.recompute()
# Assert