File tree 1 file changed +7
-11
lines changed
1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 1
1
import gc
2
2
import os
3
- import resource
4
3
import sys
5
4
import unittest
6
5
7
6
from lxml import etree
8
7
9
8
import xmlsec
10
9
11
- etype = type (etree .Element (" test" ))
10
+ etype = type (etree .Element (' test' ))
12
11
13
12
ns = {'dsig' : xmlsec .constants .DSigNs , 'enc' : xmlsec .constants .EncNs }
14
13
15
14
16
- def get_iterations ():
17
- """Parse iterations amount."""
18
- if sys .platform in ('win32' ,):
19
- return 0
15
+ try :
16
+ import resource
20
17
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
25
21
26
22
27
23
class TestMemoryLeaks (unittest .TestCase ):
28
24
maxDiff = None
29
25
30
- iterations = get_iterations ()
26
+ iterations = test_iterations
31
27
32
28
data_dir = os .path .join (os .path .dirname (__file__ ), "data" )
33
29
You can’t perform that action at this time.
0 commit comments