Skip to content

Commit 3cb1b7f

Browse files
authored
Merge pull request #249 from stackhpc/upstream/master-2026-01-26
Synchronise master with upstream
2 parents e648401 + f234217 commit 3cb1b7f

6 files changed

Lines changed: 3 additions & 35 deletions

File tree

.zuul.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
check:
3636
jobs:
3737
- magnum-tempest-plugin-tests-api
38-
- magnum-tempest-plugin-tests-api-jammy
3938
gate:
4039
jobs:
4140
- magnum-tempest-plugin-tests-api
42-
- magnum-tempest-plugin-tests-api-jammy

HACKING.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Magnum Specific Commandments
1818
- [M336] Must use a dict comprehension instead of a dict constructor
1919
with a sequence of key-value pairs.
2020
- [M338] Use assertIn/NotIn(A, B) rather than assertEqual(A in B, True/False).
21-
- [M339] Don't use xrange()
2221
- [M340] Check for explicit import of the _ function.
2322
- [M352] LOG.warn is deprecated. Enforce use of LOG.warning.
2423
- [M353] String interpolation should be delayed at logging calls.

magnum/hacking/checks.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
r"(.)*assertTrue\(isinstance\((\w|\.|\'|\"|\[|\])+, "
4545
r"(\w|\.|\'|\"|\[|\])+\)\)")
4646
dict_constructor_with_list_copy_re = re.compile(r".*\bdict\((\[)?(\(|\[)")
47-
assert_xrange_re = re.compile(
48-
r"\s*xrange\s*\(")
4947
log_translation = re.compile(
5048
r"(.)*LOG\.(audit|error|critical)\(\s*('|\")")
5149
log_translation_info = re.compile(
@@ -102,16 +100,6 @@ def assert_equal_in(logical_line):
102100
"contents.")
103101

104102

105-
@core.flake8ext
106-
def no_xrange(logical_line):
107-
"""Disallow 'xrange()'
108-
109-
M339
110-
"""
111-
if assert_xrange_re.match(logical_line):
112-
yield (0, "M339: Do not use xrange().")
113-
114-
115103
@core.flake8ext
116104
def use_timeutils_utcnow(logical_line, filename):
117105
# tools are OK to use the standard datetime module

magnum/tests/unit/objects/test_objects.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,16 +154,10 @@ def test_load_in_base(self):
154154
class Foo(base.MagnumPersistentObject, base.MagnumObject):
155155
fields = {'foobar': fields.IntegerField()}
156156
obj = Foo(self.context)
157-
# NOTE(danms): Can't use assertRaisesRegexp() because of py26
158-
raised = False
159-
ex = None
160-
try:
157+
158+
def fail():
161159
obj.foobar
162-
except NotImplementedError as e:
163-
raised = True
164-
ex = e
165-
self.assertTrue(raised)
166-
self.assertIn('foobar', str(ex))
160+
self.assertRaisesRegex(NotImplementedError, 'foobar', fail)
167161

168162
def test_loaded_in_primitive(self):
169163
obj = MyObj(self.context)

magnum/tests/unit/test_hacking.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,6 @@ def test_assert_true_isinstance(self):
150150
code = "self.assertTrue()"
151151
self._assert_has_no_errors(code, check)
152152

153-
def test_no_xrange(self):
154-
errors = [(1, 0, "M339")]
155-
check = checks.no_xrange
156-
157-
code = "xrange(45)"
158-
self._assert_has_errors(code, check, errors)
159-
160-
code = "range(45)"
161-
self._assert_has_no_errors(code, check)
162-
163153
def test_no_log_warn(self):
164154
errors = [(1, 0, "M352")]
165155
check = checks.no_log_warn

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ extension =
116116
M322 = checks:no_mutable_default_args
117117
M336 = checks:dict_constructor_with_list_copy
118118
M338 = checks:assert_equal_in
119-
M339 = checks:no_xrange
120119
M340 = checks:check_explicit_underscore_import
121120
M352 = checks:no_log_warn
122121
paths = ./magnum/hacking

0 commit comments

Comments
 (0)