Skip to content

Commit

Permalink
unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
anaegel committed Jun 13, 2024
1 parent 8eb9ead commit bd98776
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions tests/integration/test-solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,12 @@ def test_dir(directory):
for filename in os.listdir():
if not test_file(filename):
return False

except Exception as e:
print(f"Error while processing files: {e}")
return False

return True




# This is the 'old' main.
def main():
if len(sys.argv) != 2:
Expand All @@ -69,13 +65,21 @@ def main():


class TestAll(unittest.TestCase):

def test_solvers(self):
def setUp(self):
os.environ['PYVISTA_OFF_SCREEN'] = "True"
set_test_dir("content/tutorial-solver")
# self.assertEqual(test_dir("content/tutorial-solver"), True, "Must return true")
self.assertEqual(test_file("example01-smoothers.py"), True, "Must return true")
self.assertEqual(test_file("example03-multigrid.py"), True, "Must return true")

def tearDown(self):
set_test_dir("../..")

#def test_solvers(self):
# self.assertEqual(test_dir("content/tutorial-solver"), True, "Must return true")

def test_smoothers(self):
self.assertTrue(test_file("example01-smoothers.py"), "Must return true")

def test_multigrid(self):
self.assertTrue(test_file("example03-multigrid.py"), "Must return true")

if __name__ == "__main__":
# main()
Expand Down

0 comments on commit bd98776

Please sign in to comment.