Skip to content

Commit

Permalink
Log fix & testing tweak
Browse files Browse the repository at this point in the history
- Fixed a minor logging bug in some bootstrapping code
- Add some support for pytest (as a unittest running, as the output is pretty!)
  • Loading branch information
lowell80 committed Jun 12, 2020
1 parent 035677c commit 17877ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ksconf/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def get_all_ksconf_cmds(on_error="warn"):
cmd_cls = entry.load()
except (ImportError, NameError, SyntaxError) as e:
if on_error == "warn":
warn("Unable to load entrypoint for {}. Disabling."
warn("Unable to load entrypoint for {}. Disabling.\n"
"Base exception {}.".format(name, e), KsconfPluginWarning)
elif on_error == "return":
error = "Internal error: {}".format(e)
Expand All @@ -553,7 +553,7 @@ def get_all_ksconf_cmds(on_error="warn"):
raise e
continue
if not issubclass(cmd_cls, KsconfCmd):
msg = "Issue loading class for entrypoint: Disabling." \
msg = "Issue loading class for entrypoint: Disabling.\n" \
"{!r} is not derived from KsconfCmd. ".format(entry)
if on_error == "warn":
warn(msg, KsconfPluginWarning)
Expand Down
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ skip_missing_interpreters = true
commands = {envpython} setup.py install
{envpython} -m unittest discover -s tests
deps = -r requirements.txt

[pytest]
testpaths =
tests
filterwarnings =
# Can't seem to exclude TestWorkDir any other way, so we just filter out warning about it (which only pytest emits). Easier than renaming the class
ignore:.*test class 'TestWorkDir'.*:pytest.PytestCollectionWarning

0 comments on commit 17877ad

Please sign in to comment.