diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2016-01-27 15:54:47 +0100 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2016-01-27 15:54:47 +0100 |
commit | dd5e979d43e1c6938a344e013e04eb4477c9f165 (patch) | |
tree | 72ec5026c6a6930865034e4d11647ef4a5869261 | |
parent | 4a6a2b7b7facd5bcbf8b9e137d0047a170c5e8d4 (diff) | |
download | rsa-git-dd5e979d43e1c6938a344e013e04eb4477c9f165.tar.gz |
Simplified test structure a bit, so we no longer need to set PYTHONPATH
The u'' string prefix was reintroduced in Python 3.3, and since we've
dropped py3.2 support we can avoid the whole py{2k,3k}constants.py mess.
-rw-r--r-- | rsa/_compat.py | 2 | ||||
-rw-r--r-- | tests/constants.py | 22 | ||||
-rw-r--r-- | tests/py2kconstants.py | 17 | ||||
-rw-r--r-- | tests/py3kconstants.py | 17 | ||||
-rw-r--r-- | tests/test_strings.py | 2 | ||||
-rw-r--r-- | tox.ini | 2 |
6 files changed, 1 insertions, 61 deletions
diff --git a/rsa/_compat.py b/rsa/_compat.py index c654770..6fb9b62 100644 --- a/rsa/_compat.py +++ b/rsa/_compat.py @@ -44,11 +44,9 @@ else: try: # < Python3 unicode_type = unicode - have_python3 = False except NameError: # Python3. unicode_type = str - have_python3 = True # Fake byte literals. if str is unicode_type: diff --git a/tests/constants.py b/tests/constants.py deleted file mode 100644 index 9a96774..0000000 --- a/tests/constants.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from rsa._compat import have_python3 - -if have_python3: - from py3kconstants import * -else: - from py2kconstants import * diff --git a/tests/py2kconstants.py b/tests/py2kconstants.py deleted file mode 100644 index 0b53a78..0000000 --- a/tests/py2kconstants.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -unicode_string = u"Euro=\u20ac ABCDEFGHIJKLMNOPQRSTUVWXYZ" diff --git a/tests/py3kconstants.py b/tests/py3kconstants.py deleted file mode 100644 index c12a39b..0000000 --- a/tests/py3kconstants.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -unicode_string = "Euro=\u20ac ABCDEFGHIJKLMNOPQRSTUVWXYZ" diff --git a/tests/test_strings.py b/tests/test_strings.py index 541b317..2b9a1d1 100644 --- a/tests/test_strings.py +++ b/tests/test_strings.py @@ -22,7 +22,7 @@ import unittest import rsa -from constants import unicode_string +unicode_string = u"Euro=\u20ac ABCDEFGHIJKLMNOPQRSTUVWXYZ" class StringTest(unittest.TestCase): @@ -6,8 +6,6 @@ envlist = py26,py27,py33,py34,py35,pypy addopts = -v --cov rsa --cov-report term-missing [testenv] -setenv = - PYTHONPATH = {toxinidir}:{toxinidir}/tests commands=py.test [] deps=pyasn1 >=0.1.3 coverage >=3.5 |