Merged
Conversation
This removes all the imports into the top-level. They're not necessary here and are producing circular import errors.
That is, up to (but not including) the point where the `State` is created. This is includes unit tests for all of `coco/config.py` and a bit of `coco/core.py`. The revamped test suite uses `pyfakefs` for test isolation. I've written a small number of fixtures in the pytest-default `conftest.py` file to simplify tests. Specific fixes / changes: * If an explicitly-given config file (i.e. via `-c` on the command line and/or the `COCO_CONFIG_FILE` environmental variable) is missing, cocod now exits with a fatal error. Previously it would silently ignore these missing files. * I/O, character encoding and YAML errors in config files and endpoints now produce meaningful error messages. * An invalid "log_level" in the config is now handled gracefully via fatal error. * An early exit of `cocod` no longer crashes on exit with a `NameError` (due to `redis_sync` not being defined early enough). * Config errors noticed by `cocod` are now reported using `click.ClickException` instead of coco's `ConfigError` for proper CLI exit.
ljgray
approved these changes
Apr 10, 2026
Member
Author
|
|
ketiltrout
added a commit
that referenced
this pull request
Apr 11, 2026
Instead of the monkeypatching of PyYAML's `SafeLoader`, there's now just a wrapper around the `safe_load` call that does post-processing on the returned `dict`. Requires #262
ketiltrout
added a commit
that referenced
this pull request
Apr 16, 2026
Specific fixes: * defer compiling the TIMEDELTA regex until first use. * catch various input errors to `Host` * removed dependency on `atomicwrites` (unmaintained since 2022) Requires #262
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unit tests for
cocodup to the end of config file loading.That is, up to (but not including) the point where the
Stateis created. This is includes unit tests for all ofcoco/config.pyand a bit ofcoco/core.py.The revamped test suite uses
pyfakefsfor test isolation. I've written a small number of fixtures in the pytest-defaultconftest.pyfile to simplify tests.Specific fixes / changes:
coco/__init__.pywhich might have made sense if coco were being used as a library package, but doesn't seem helpful here and is causing problems with circular imports.-con the command line and/or theCOCO_CONFIG_FILEenvironmental variable) is missing, cocod now exits with a fatal error. Previously it would silently ignore these missing files.cocodno longer crashes on exit with aAttributeError(due toredis_syncnot being defined early enough).cocodare now reported usingclick.ClickExceptioninstead of coco'sConfigErrorfor proper CLI exit.