File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import gc
22import os
3- import resource
43import sys
54import unittest
65
76from lxml import etree
87
98import xmlsec
109
11- etype = type (etree .Element (" test" ))
10+ etype = type (etree .Element (' test' ))
1211
1312ns = {'dsig' : xmlsec .constants .DSigNs , 'enc' : xmlsec .constants .EncNs }
1413
1514
16- def get_iterations ():
17- """Parse iterations amount."""
18- if sys .platform in ('win32' ,):
19- return 0
15+ try :
16+ import resource
2017
21- try :
22- return int (os .getenv ("PYXMLSEC_TEST_ITERATIONS" , "10" ))
23- except ValueError :
24- return 0
18+ test_iterations = int (os .environ .get ('PYXMLSEC_TEST_ITERATIONS' , '10' ))
19+ except (ImportError , ValueError ):
20+ test_iterations = 0
2521
2622
2723class TestMemoryLeaks (unittest .TestCase ):
2824 maxDiff = None
2925
30- iterations = get_iterations ()
26+ iterations = test_iterations
3127
3228 data_dir = os .path .join (os .path .dirname (__file__ ), "data" )
3329
You can’t perform that action at this time.
0 commit comments