Skip to content

Commit f2e64e9

Browse files
authored
Merge pull request #441 from tlsfuzzer/py33-0.7
revive py33 test coverage
2 parents c28d6d3 + 70b3647 commit f2e64e9

5 files changed

+57
-14
lines changed

.travis.yml

+23-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ addons:
1717
- swig
1818
# needed for GMPY
1919
- libgmp-dev
20+
# needed for GMPY2
21+
- libmpfr-dev
22+
- libmpc-dev
2023
before_cache:
2124
- rm -f $HOME/.cache/pip/log/debug.log
2225

@@ -26,6 +29,8 @@ jobs:
2629
env: TACKPY=false
2730
- python: 2.7
2831
env: TACKPY=false
32+
- python: 3.3
33+
env: TACKPY=false
2934
- python: 3.4
3035
env: TACKPY=false
3136
- python: 3.5
@@ -60,6 +65,14 @@ jobs:
6065
dist: xenial
6166
sudo: true
6267
env: M2CRYPTO=true
68+
- python: 3.8
69+
dist: xenial
70+
sudo: true
71+
env: M2CRYPTO=true
72+
- python: 3.9
73+
dist: xenial
74+
sudo: true
75+
env: M2CRYPTO=true
6376
- python: 2.7
6477
env: PYCRYPTO=true
6578
- python: 3.4
@@ -122,7 +135,14 @@ before_install:
122135
install:
123136
- if [[ -e build-requirements-${TRAVIS_PYTHON_VERSION}.txt ]]; then travis_retry pip install -r build-requirements-${TRAVIS_PYTHON_VERSION}.txt; else travis_retry pip install -r build-requirements.txt; fi
124137
- if [[ $TACKPY == 'true' ]]; then travis_retry pip install tackpy; fi
125-
- if [[ $M2CRYPTO == 'true' ]]; then travis_retry pip install --pre m2crypto; fi
138+
- |
139+
if [[ $M2CRYPTO == 'true' ]]; then
140+
if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]] || [[ $TRAVIS_PYTHON_VERSION == 3.4 ]] || [[ $TRAVIS_PYTHON_VERSION == 3.5 ]] || [[ $TRAVIS_PYTHON_VERSION == 3.6 ]] ; then
141+
travis_retry pip install 'm2crypto<0.37';
142+
else
143+
travis_retry pip install --pre m2crypto;
144+
fi
145+
fi
126146
- if [[ $PYCRYPTO == 'true' ]]; then travis_retry pip install pycrypto; fi
127147
- if [[ $PYCRYPTODOME == 'true' ]]; then travis_retry pip install pycryptodome; fi
128148
- if [[ $GMPY == 'true' ]]; then travis_retry pip install gmpy; fi
@@ -138,14 +158,13 @@ script:
138158
fi
139159
- make test-local
140160
# --appends is supported only in the new coverage (>4)
141-
- if [[ $TRAVIS_PYTHON_VERSION != '3.2' ]]; then coverage combine --append; fi
161+
- coverage combine --append
142162
- coverage report -m
143163
- ./setup.py install
144164
- make test
145165
# pylint doesn't work on 2.6: https://bitbucket.org/logilab/pylint/issue/390/py26-compatiblity-broken
146-
# diff-quality doesn't work on 3.2: https://github.com/edx/diff-cover/issues/94
147166
- |
148-
if [[ $TRAVIS_PYTHON_VERSION != '2.6' ]] && [[ $TRAVIS_PYTHON_VERSION != '3.2' ]]; then
167+
if [[ $TRAVIS_PYTHON_VERSION != '2.6' ]]; then
149168
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" tlslite > pylint_report.txt || :
150169
diff-quality --violations=pylint --fail-under=90 pylint_report.txt
151170
fi

build-requirements-3.2.txt

-10
This file was deleted.

build-requirements-3.3.txt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
enum34
2+
coverage<5.0
3+
hypothesis<3.44
4+
coveralls
5+
pylint
6+
diff_cover<2.5.0
7+
typed-ast<1.3.0
8+
inflect<4.0.0

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
'Programming Language :: Python :: 2.6',
3636
'Programming Language :: Python :: 2.7',
3737
"Programming Language :: Python :: 3",
38+
'Programming Language :: Python :: 3.3',
3839
'Programming Language :: Python :: 3.4',
3940
'Programming Language :: Python :: 3.5',
4041
'Programming Language :: Python :: 3.6',

unit_tests/test_tlslite_utils_deprecations.py

+25
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,31 @@
1919
from tlslite.utils.deprecations import deprecated_params, \
2020
deprecated_attrs
2121

22+
# see https://github.com/pytest-dev/py/issues/110
23+
# preload the list until the list of loaded modules is static
24+
try:
25+
import py.error
26+
except ImportError:
27+
pass # ignore
28+
import sys
29+
while True:
30+
end = True
31+
for v in list(sys.modules.values()):
32+
old = set(sys.modules.values())
33+
_ = getattr(v, '__warningregistry__', None)
34+
new = set(sys.modules.values())
35+
if new - old:
36+
end = False
37+
if end:
38+
break
39+
for v in list(sys.modules.values()):
40+
old = set(sys.modules.values())
41+
_ = getattr(v, '__warningregistry__', None)
42+
new = set(sys.modules.values())
43+
if new - old:
44+
print("changed: {0}".format(new - old))
45+
46+
2247

2348
class TestDeprecatedParams(unittest.TestCase):
2449
def test_no_changes(self):

0 commit comments

Comments
 (0)