Browse Source

add python 3.6 unit test job

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

This also modifies a unit test to not attempt to pass the re.LOCALE flag
when the regex is a string, which is prohibited in Python 3.6. It would
be possible to use a raw bytes object as the regex instead, but we're
testing the repr() here and it has a different representation between
Python 2 and Python 3. Just use the re.IGNORECASE flag instead for the
purposes of the test.

Change-Id: I666d49d0a29963bcaef6ca69be34dc4869f6db6f
Co-Authored-By: Zane Bitter <zbitter@redhat.com>
Story: #2002586
Task: #24322
Doug Hellmann 8 months ago
parent
commit
34a010e168
2 changed files with 3 additions and 2 deletions
  1. 1
    0
      .zuul.yaml
  2. 2
    2
      mox3/tests/test_mox.py

+ 1
- 0
.zuul.yaml View File

@@ -11,3 +11,4 @@
11 11
       - publish-openstack-docs-pti
12 12
       - check-requirements
13 13
       - periodic-stable-jobs
14
+      - openstack-python36-jobs

+ 2
- 2
mox3/tests/test_mox.py View File

@@ -320,8 +320,8 @@ class RegexTest(testtools.TestCase):
320 320
 
321 321
     def testReprWithFlags(self):
322 322
         """repr should return the regular expression pattern and flags."""
323
-        self.assertTrue(repr(mox.Regex(r"a\s+b", flags=4)) ==
324
-                        "<regular expression 'a\s+b', flags=4>")
323
+        self.assertTrue(repr(mox.Regex(r"a\s+b", flags=2)) ==
324
+                        "<regular expression 'a\s+b', flags=2>")
325 325
 
326 326
 
327 327
 class IsTest(testtools.TestCase):

Loading…
Cancel
Save