pytest_gee#

The init file of the package.

Submodules#

Attributes#

Functions#

init_ee_from_service_account()

Initialize earth engine according using a service account.

init_ee_from_token()

Initialize earth engine according using a token.

wait(task[, timeout])

Wait until the selected process is finished or we reached timeout value.

Package Contents#

pytest_gee.init_ee_from_service_account()[source]#

Initialize earth engine according using a service account.

The environment used to run the tests need to have a EARTHENGINE_SERVICE_ACCOUNT variable. The content of this variable must be the copy of a personal credential file that you can generate from the google cloud console.

Note

As all init method of pytest-gee, this method will fallback to a regular ee.Initialize using the EARTHENGINE_PROJECT environment variable.

pytest_gee.init_ee_from_token()[source]#

Initialize earth engine according using a token.

THe environment used to run the tests need to have a EARTHENGINE_TOKEN variable. The content of this variable must be the copy of a personal credential file that you can find on your local computer if you already run the earth engine command line tool. See the usage question for a github action example.

  • Windows: C:\Users\USERNAME\\.config\\earthengine\\credentials

  • Linux: /home/USERNAME/.config/earthengine/credentials

  • MacOS: /Users/USERNAME/.config/earthengine/credentials

Note

As all init method of pytest-gee, this method will fallback to a regular ee.Initialize() if the environment variable is not found e.g. on your local computer.

pytest_gee.wait(task, timeout=5 * 60)[source]#

Wait until the selected process is finished or we reached timeout value.

Parameters:
  • task (Union[ee.batch.Task, str]) – name of the running task or the Task object itself.

  • timeout (int) – timeout in seconds. if set to 0 the parameter is ignored. default to 5 minutes.

Returns:

the final state of the task

Return type:

str

pytest_gee.__author__ = 'Pierrick Rambaud'[source]#
pytest_gee.__email__ = 'pierrick.rambaud49@gmail.com'[source]#
pytest_gee.__version__ = '0.8.1'[source]#