mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-40275: Use new test.support helper submodules in tests (GH-21314)
This commit is contained in:
parent
9ce8132e1f
commit
883bc63833
19 changed files with 225 additions and 194 deletions
|
@ -9,13 +9,14 @@ import tempfile
|
|||
import unittest
|
||||
|
||||
from test import support
|
||||
from test.support import os_helper
|
||||
|
||||
|
||||
def without_source_date_epoch(fxn):
|
||||
"""Runs function with SOURCE_DATE_EPOCH unset."""
|
||||
@functools.wraps(fxn)
|
||||
def wrapper(*args, **kwargs):
|
||||
with support.EnvironmentVarGuard() as env:
|
||||
with os_helper.EnvironmentVarGuard() as env:
|
||||
env.unset('SOURCE_DATE_EPOCH')
|
||||
return fxn(*args, **kwargs)
|
||||
return wrapper
|
||||
|
@ -25,7 +26,7 @@ def with_source_date_epoch(fxn):
|
|||
"""Runs function with SOURCE_DATE_EPOCH set."""
|
||||
@functools.wraps(fxn)
|
||||
def wrapper(*args, **kwargs):
|
||||
with support.EnvironmentVarGuard() as env:
|
||||
with os_helper.EnvironmentVarGuard() as env:
|
||||
env['SOURCE_DATE_EPOCH'] = '123456789'
|
||||
return fxn(*args, **kwargs)
|
||||
return wrapper
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue