summaryrefslogtreecommitdiff
path: root/tests/type/test_namedval.py
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2019-11-23 09:57:24 +0100
committerGitHub <noreply@github.com>2019-11-23 09:57:24 +0100
commit2b646e07d5d83f0892fa2a809ae4c981430cb12c (patch)
tree20b10450bced84c425ca0735b4ee7202e68ee1ec /tests/type/test_namedval.py
parent788af3c44edc2ebd079eda3f7a4ae2f9931446fd (diff)
parentf10434e31f9293c4e739ac6c5d1519f407bd1540 (diff)
downloadpyasn1-git-2b646e07d5d83f0892fa2a809ae4c981430cb12c.tar.gz
Merge branch 'master' into streamoptimum37
Diffstat (limited to 'tests/type/test_namedval.py')
-rw-r--r--tests/type/test_namedval.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/type/test_namedval.py b/tests/type/test_namedval.py
index 4ac08cf..eae6b4d 100644
--- a/tests/type/test_namedval.py
+++ b/tests/type/test_namedval.py
@@ -5,12 +5,7 @@
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
-
-try:
- import unittest2 as unittest
-
-except ImportError:
- import unittest
+import unittest
from tests.base import BaseTestCase
@@ -23,10 +18,10 @@ class NamedValuesCaseBase(BaseTestCase):
self.e = namedval.NamedValues(('off', 0), ('on', 1))
def testDict(self):
- assert set(self.e.items()) == set([('off', 0), ('on', 1)])
- assert set(self.e.keys()) == set(['off', 'on'])
- assert set(self.e) == set(['off', 'on'])
- assert set(self.e.values()) == set([0, 1])
+ assert set(self.e.items()) == {('off', 0), ('on', 1)}
+ assert set(self.e.keys()) == {'off', 'on'}
+ assert set(self.e) == {'off', 'on'}
+ assert set(self.e.values()) == {0, 1}
assert 'on' in self.e and 'off' in self.e and 'xxx' not in self.e
assert 0 in self.e and 1 in self.e and 2 not in self.e