1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00
Ivan Grokhotkov 1acaa8b8f6 allow reading test environment from python mocks
This allows requesting environment variable values set in the C++ test
code, from python mock code. Use case is cross-checking test
results against values expected by the host side part of the test.
2018-04-11 11:19:21 +08:00

12 lines
363 B
Python

from mock_decorators import setup, teardown, setenv, request_env
@setup('environment variables can be set and read from python')
def setup_envtest(e):
setenv(e, 'VAR_FROM_PYTHON', '42')
@teardown('environment variables can be set and read from python')
def teardown_envtest(e):
env_value = request_env(e, 'VAR_FROM_TEST')
assert(env_value == '24')