From 1dcb0fbf5f354f5234f43ee90fe0e0de18acbe74 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 26 Jan 2024 10:54:02 +0000 Subject: [PATCH] minor fixes, cleanups --- .github/workflows/pylint.yaml | 1 + mmgen/cfg.py | 6 ++++-- test/test-release.d/cfg.sh | 1 + test/unit_tests.py | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pylint.yaml b/.github/workflows/pylint.yaml index 8f63aaa5..e44d0741 100644 --- a/.github/workflows/pylint.yaml +++ b/.github/workflows/pylint.yaml @@ -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 diff --git a/mmgen/cfg.py b/mmgen/cfg.py index 500d7966..6d58b1db 100755 --- a/mmgen/cfg.py +++ b/mmgen/cfg.py @@ -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, ( diff --git a/test/test-release.d/cfg.sh b/test/test-release.d/cfg.sh index 23b56034..6483ad9f 100755 --- a/test/test-release.d/cfg.sh +++ b/test/test-release.d/cfg.sh @@ -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 " diff --git a/test/unit_tests.py b/test/unit_tests.py index 36a44ad3..277af576 100755 --- a/test/unit_tests.py +++ b/test/unit_tests.py @@ -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 = []