diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-04-09 08:36:46 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-04-09 08:36:46 (GMT) |
commit | ce4a9c901905624216bc5ae7ae631ecb94c2d66e (patch) | |
tree | 50069f3281cc062383a958a366c8b24763ddefe2 /Lib/test/test_decimal.py | |
parent | aa34b6c2e32d3ff93ffe48fe6a67e87a28a3eed2 (diff) | |
download | cpython-ce4a9c901905624216bc5ae7ae631ecb94c2d66e.zip cpython-ce4a9c901905624216bc5ae7ae631ecb94c2d66e.tar.gz cpython-ce4a9c901905624216bc5ae7ae631ecb94c2d66e.tar.bz2 |
Fix tests so they pass in -R mode
Diffstat (limited to 'Lib/test/test_decimal.py')
-rw-r--r-- | Lib/test/test_decimal.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 844cee0..f3f9215 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -42,11 +42,13 @@ Signals = getcontext().flags.keys() # Tests are built around these assumed context defaults. # test_main() restores the original context. -ORIGINAL_CONTEXT = getcontext().copy() -DefaultContext.prec = 9 -DefaultContext.rounding = ROUND_HALF_EVEN -DefaultContext.traps = dict.fromkeys(Signals, 0) -setcontext(DefaultContext) +def init(): + global ORIGINAL_CONTEXT + ORIGINAL_CONTEXT = getcontext().copy() + DefaultContext.prec = 9 + DefaultContext.rounding = ROUND_HALF_EVEN + DefaultContext.traps = dict.fromkeys(Signals, 0) + setcontext(DefaultContext) TESTDATADIR = 'decimaltestdata' if __name__ == '__main__': @@ -1069,6 +1071,7 @@ def test_main(arith=False, verbose=None): is enabled in regrtest.py """ + init() global TEST_ALL TEST_ALL = arith or is_resource_enabled('decimal') |