pymasep.tests

This package provides unit tests method/fixture for the pymasep package and applications.

Submodules

Functions

remove_recursive_file(path, pattern)

Remove files with a certain pattern inside path and subdirectories

mock_game(game_class)

Create a mock game for the current project with empty configuration

mock_environment(mock_game)

Create a mock environment for the current project with empty configuration

mock_environment_conf(configuration, game_class)

Create a mock environment for the current project with configuration defined as fixture

base_directory(relative_path, request)

Pytest fixture that set the base directory for the tests

base_directory_unit(relative_path, request)

Pytest fixture that set the base directory for the unit tests

cleanup(request)

Cleanup a testing directory once we are finished.

Package Contents

pymasep.tests.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/

Parameters:
  • path (str) – Path to recursively search in.

  • pattern (str) – The file patterns to delete.

Raises:
  • PermissionError – In windows (file still open ?) TO REFACTOR

  • OSError – if error occurs during deletion

Return type:

None

pymasep.tests.mock_game(game_class)

Create a mock game for the current project with empty configuration

pymasep.tests.mock_environment(mock_game)

Create a mock environment for the current project with empty configuration

pymasep.tests.mock_environment_conf(configuration, game_class)

Create a mock environment for the current project with configuration defined as fixture

pymasep.tests.base_directory(relative_path, request)

Pytest fixture that set the base directory for the tests

pymasep.tests.base_directory_unit(relative_path, request)

Pytest fixture that set the base directory for the unit tests

pymasep.tests.cleanup(request)

Cleanup a testing directory once we are finished.