Browse Source

minor fixes, cleanups

The MMGen Project 9 months ago
parent
commit
1dcb0fbf5f
4 changed files with 8 additions and 4 deletions
  1. 1 0
      .github/workflows/pylint.yaml
  2. 4 2
      mmgen/cfg.py
  3. 1 0
      test/test-release.d/cfg.sh
  4. 2 2
      test/unit_tests.py

+ 1 - 0
.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

+ 4 - 2
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, (

+ 1 - 0
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
 	"
 

+ 2 - 2
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 = []