From dab61e1b4e38a0b5c1446008dad5366f5b5a84bb Mon Sep 17 00:00:00 2001 From: Spiros Delviniotis Date: Thu, 17 Aug 2017 17:10:46 +0200 Subject: [PATCH] tests: support for `scrapy-crawl-once` Addresses #161 Signed-off-by: Spiros Delviniotis --- tests/functional/arxiv/test_arxiv.py | 4 ++++ tests/functional/wsp/test_wsp.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/tests/functional/arxiv/test_arxiv.py b/tests/functional/arxiv/test_arxiv.py index 0f58b17d..2ef86b87 100644 --- a/tests/functional/arxiv/test_arxiv.py +++ b/tests/functional/arxiv/test_arxiv.py @@ -11,6 +11,7 @@ from __future__ import absolute_import, division, print_function +import os from time import sleep import pytest @@ -20,6 +21,7 @@ from hepcrawl.testlib.fixtures import ( get_test_suite_path, expected_json_results_from_file, + clean_dir, ) @@ -51,6 +53,8 @@ def set_up_local_environment(): } } + clean_dir(path=os.path.join(os.getcwd(), '.scrapy')) + @pytest.mark.parametrize( 'expected_results', diff --git a/tests/functional/wsp/test_wsp.py b/tests/functional/wsp/test_wsp.py index 42f691c9..ffa4c4c9 100644 --- a/tests/functional/wsp/test_wsp.py +++ b/tests/functional/wsp/test_wsp.py @@ -56,6 +56,7 @@ def set_up_ftp_environment(): } clean_dir(path='/tmp/WSP/') + clean_dir(path=os.path.join(os.getcwd(), '.scrapy')) @pytest.fixture(scope="function") @@ -81,6 +82,7 @@ def set_up_local_environment(): def remove_generated_files(package_location): clean_dir(path='/tmp/WSP/') + clean_dir(path=os.path.join(os.getcwd(), '.scrapy')) _, dirs, files = next(os.walk(package_location)) for dir_name in dirs: