minor fixes, cleanups

This commit is contained in:
The MMGen Project 2024-01-26 10:54:02 +00:00
commit 1dcb0fbf5f
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
4 changed files with 8 additions and 4 deletions

View file

@ -37,4 +37,5 @@ jobs:
run: |
pylint --errors-only mmgen
pylint --errors-only test
pylint --errors-only examples
pylint --errors-only --disable=relative-beyond-top-level test/cmdtest_py_d

View file

@ -399,8 +399,10 @@ class Config(Lockable):
do_post_init = False,
process_opts = False ):
# Step 1: get user-supplied configuration data from a) command line, or b) first argument
# to constructor; save to self._uopts:
# Step 1: get user-supplied configuration data from
# a) command line, or
# b) first argument to constructor;
# save to self._uopts:
self._cloned = {}
if opts_data or parsed_opts or process_opts:
assert cfg is None, (

View file

@ -69,6 +69,7 @@ init_tests() {
t_lint="
- $pylint --errors-only mmgen
- $pylint --errors-only test
- $pylint --errors-only examples
- $pylint --errors-only --disable=relative-beyond-top-level test/cmdtest_py_d
"

View file

@ -126,7 +126,7 @@ class UnitTestHelpers:
exc_w = max(len(e[1]) for e in data)
m_exc = '{!r}: incorrect exception type (expected {!r})'
m_err = '{!r}: incorrect error msg (should match {!r}'
m_noraise = "\nillegal action 'bad {}' failed to raise an exception (expected {!r})"
m_noraise = "\nillegal action '{}{}' failed to raise an exception (expected {!r})"
for (desc,exc_chk,emsg_chk,func) in data:
try:
cfg._util.vmsg_r(' {}{:{w}}'.format(pfx, desc+':', w=desc_w+1))
@ -138,7 +138,7 @@ class UnitTestHelpers:
assert exc == exc_chk, m_exc.format(exc,exc_chk)
assert re.search(emsg_chk,emsg), m_err.format(emsg,emsg_chk)
else:
die(4,m_noraise.format(desc,exc_chk))
die(4,m_noraise.format(pfx,desc,exc_chk))
tests_seen = []