def setup_psyclone_config(): '''This per session fixture defines the environment variable PSYCLONE_CONFIG to point to the config file included in the PSyclone repo. This way all tests will get the same config, independent of a potential psyclone config file installed by the user. ''' config_file = Config.get_repository_config_file() # In case that PSyclone is installed and tested (e.g. GitHub Actions), # the 'repository' config file does not exist (since it is # installed in a different directory). In that case the standard # search path of the Configuration object will find the right # config file. So only overwrite the default search path behaviour # if the repository config file is actually found: if os.path.isfile(config_file): os.environ["PSYCLONE_CONFIG"] = config_file
def test_get_repo_config_file(): '''Check the mechanism by which we ensure that the repository config file is picked up by the test suite. ''' config_file = Config.get_repository_config_file() assert "config/psyclone.cfg" in config_file