Skip to content

Commit

Permalink
Check if the file exists, if it exists then delete it, to avoid doubl…
Browse files Browse the repository at this point in the history
…e deletion
  • Loading branch information
Saransh-cpp committed Jul 2, 2021
1 parent f990ff1 commit 05f9cca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_random_plot_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
class TestRandomPlotGenerator(unittest.TestCase):

def tearDown(self):
os.remove("plot.png")
os.remove("plot.gif")
if os.path.exists("plot.png"):
os.remove("plot.png")
elif os.path.exists("plot.gif"):
os.remove("plot.gif")

def test_random_plot_generator(self):

Expand Down

0 comments on commit 05f9cca

Please sign in to comment.