Skip to content

Commit

Permalink
feat: saving all info and yielding instead of returning
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 committed Feb 10, 2025
1 parent d15cb1a commit e911488
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions tests/test_xpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ def create_cube(self, mapdl):

clear(mapdl)

# Delete files
self.full_file = mapdl.jobname + ".full"

if "full.file" in mapdl.list_files():
mapdl.slashdelete("full.file")

if mapdl.result_file in mapdl.list_files():
mapdl.slashdelete(mapdl.result_file)

# set up the full file
mapdl.block(0, 1, 0, 1, 0, 1)
mapdl.et(1, 186)
Expand All @@ -59,18 +68,9 @@ def create_cube(self, mapdl):
mapdl.esize(0.5)
mapdl.vmesh("all")

# Delete files
self.full_file = mapdl.jobname + ".full"

if "full.file" in mapdl.list_files():
mapdl.slashdelete("full.file")

if mapdl.result_file in mapdl.list_files():
mapdl.slashdelete(mapdl.result_file)

# solve first 10 non-trivial modes
mapdl.modal_analysis(nmode=10, freqb=1, method="UNSYMM")
mapdl.save("cube_solve_xpl")
mapdl.modal_analysis(nmode=10, freqb=1)
mapdl.save("cube_solve_xpl", slab="all")

@pytest.fixture(scope="class")
def cube_solve(self, mapdl):
Expand All @@ -86,7 +86,8 @@ def xpl(self, mapdl, cube_solve):
self.create_cube(mapdl)

xpl.open(self.full_file)
return xpl
yield xpl
xpl.close()

@staticmethod
def test_close(xpl):
Expand Down

0 comments on commit e911488

Please sign in to comment.