pymasep.tests ============= .. py:module:: pymasep.tests .. autoapi-nested-parse:: This package provides unit tests method/fixture for the pymasep package and applications. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/pymasep/tests/fixtures/index Functions --------- .. autoapisummary:: pymasep.tests.remove_recursive_file pymasep.tests.mock_game pymasep.tests.mock_environment pymasep.tests.mock_environment_conf pymasep.tests.base_directory pymasep.tests.base_directory_unit pymasep.tests.cleanup Package Contents ---------------- .. py:function:: remove_recursive_file(path, pattern) Remove files with a certain pattern inside path and subdirectories Copyright © 2022 thisPointer Thanks https://thispointer.com/python-how-to-remove-files-by-matching-pattern-wildcards-certain-extensions-only/ :param path: Path to recursively search in. :param pattern: The file patterns to delete. :raise PermissionError: In windows (file still open ?) TO REFACTOR :raise OSError: if error occurs during deletion .. py:function:: mock_game(game_class) Create a mock game for the current project with empty configuration .. py:function:: mock_environment(mock_game) Create a mock environment for the current project with empty configuration .. py:function:: mock_environment_conf(configuration, game_class) Create a mock environment for the current project with configuration defined as fixture .. py:function:: base_directory(relative_path, request) Pytest fixture that set the base directory for the tests .. py:function:: base_directory_unit(relative_path, request) Pytest fixture that set the base directory for the unit tests .. py:function:: cleanup(request) Cleanup a testing directory once we are finished.