From d8e45554f4a4d486a329aa3826215cc413fda7fb Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 20 May 2020 10:52:42 -0300 Subject: [PATCH] Moved the .pro and fp-cache to the context clean_up --- tests/test_plot/test_position.py | 1 - tests/test_plot/test_print_pcb.py | 4 ---- tests/test_plot/test_print_sch.py | 2 -- tests/utils/context.py | 8 ++++++++ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/test_plot/test_position.py b/tests/test_plot/test_position.py index bae776d7..58a4b340 100644 --- a/tests/test_plot/test_position.py +++ b/tests/test_plot/test_position.py @@ -134,4 +134,3 @@ def test_3Rs_position_inches_csv(): expect_position(ctx, pos_top, ['R1'], ['R2', 'R3'], inches=True, csv=True) expect_position(ctx, pos_bot, ['R2'], ['R1', 'R3'], inches=True, csv=True) ctx.clean_up() - diff --git a/tests/test_plot/test_print_pcb.py b/tests/test_plot/test_print_pcb.py index ea16f99f..f03a1070 100644 --- a/tests/test_plot/test_print_pcb.py +++ b/tests/test_plot/test_print_pcb.py @@ -27,8 +27,4 @@ def test_print_sch(): ctx.run() # Check all outputs are there ctx.expect_out_file(os.path.join(PDF_DIR, PDF_FILE)) - # We don't have a project, and we don't want one - os.remove(os.path.join(ctx.get_board_dir(), prj+'.pro')) - # We don't have a footprint cache, and we don't want one - os.remove(os.path.join(ctx.get_board_dir(), 'fp-info-cache')) ctx.clean_up() diff --git a/tests/test_plot/test_print_sch.py b/tests/test_plot/test_print_sch.py index 4e6d4160..e2c57bb8 100644 --- a/tests/test_plot/test_print_sch.py +++ b/tests/test_plot/test_print_sch.py @@ -27,6 +27,4 @@ def test_print_sch(): ctx.run() # Check all outputs are there ctx.expect_out_file(PDF_FILE) - # We don't have a project, and we don't want one - os.remove(os.path.join(ctx.get_board_dir(), prj+'.pro')) ctx.clean_up() diff --git a/tests/utils/context.py b/tests/utils/context.py index 95dc286a..ff206e31 100644 --- a/tests/utils/context.py +++ b/tests/utils/context.py @@ -75,6 +75,14 @@ class TestContext(object): if self._del_dir_after: logging.debug('Removing dir') shutil.rmtree(self.output_dir) + # We don't have a project, and we don't want one + pro = os.path.join(self.get_board_dir(), self.board_name+'.pro') + if os.path.isfile(pro): + os.remove(pro) + # We don't have a footprint cache, and we don't want one + fp_cache = os.path.join(self.get_board_dir(), 'fp-info-cache') + if os.path.isfile(fp_cache): + os.remove(fp_cache) def get_out_path(self, filename): return os.path.join(self.output_dir, filename)