Runs function with SOURCE_DATE_EPOCH set.
(fxn)
| 24 | |
| 25 | |
| 26 | def with_source_date_epoch(fxn): |
| 27 | """Runs function with SOURCE_DATE_EPOCH set.""" |
| 28 | @functools.wraps(fxn) |
| 29 | def wrapper(*args, **kwargs): |
| 30 | with os_helper.EnvironmentVarGuard() as env: |
| 31 | env['SOURCE_DATE_EPOCH'] = '123456789' |
| 32 | return fxn(*args, **kwargs) |
| 33 | return wrapper |
| 34 | |
| 35 | |
| 36 | # Run tests with SOURCE_DATE_EPOCH set or unset explicitly. |