Add tests and fix bugs#1
Merged
Merged
Conversation
Member
|
I approved CI to run and it's currently failing. Please provide better commit messages. |
Collaborator
Author
|
The CI issues appear to pre-date these changes. Folded in the fixes with a more detailed commit message. |
|
augment review |
🤖 Augment PR SummarySummary: This PR substantially expands the test suite and fixes multiple functional bugs uncovered by the new coverage. Changes:
Technical Notes: Coverage notes are documented (including deliberate gaps/xfails) and overall coverage is reported as ~99%. 🤖 Was this summary useful? React with 👍 or 👎 |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
- Catch (RuntimeError, AttributeError) and degrade to "no user"
- Prefer getattr(current_app, 'login_manager', None), falling back to the extensions dict.
- Load real submodules via importlib.import_module(...)
- Rename to blocksEachUrl
- Add dt_time: lambda o: {'_': ['time', str(o)]}
- Use stack.enter_context(getattr(plugin, method_name)())
- Change to if new_value_at is None: so only a real dict.update() → None indicates a mutable value
- Replace with a polyglot /bin/sh + Python bootstrap that re-execs under the first real system python3
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.
Added test to confirm functionality
A lot of tests, found 8 bugs, made a few small code improvements.
context.py—user_resolveRuntimeError. Whenflask_loginis installed but noLoginManageris configured,current_user._get_current_object()raisesAttributeError.before_requesthook callsuser_resolve).(RuntimeError, AttributeError)and degrade to "no user".hypergen.py—check_permscurrent_app.extensions['login_manager'], butflask_loginstores it ascurrent_app.login_manager.login_urlisn't passed) never fired; returned 403 instead of a 302 redirect.getattr(current_app, 'login_manager', None), falling back to the extensions dict.imports.py— flat-namespace re-exportfrom flask_hypergen import context as context_moduleresolved the instancecontext(shadowed by__init__), not the submodule, so its__all__was empty.from flask_hypergen.imports import *silently exported onlytemplateandwebsocket, droppingcontext,liveview,action,callback, etc.importlib.import_module(...).liveview.py— callback payloadeachUrlBlocks.blocksEachUrl), so the client never read it.blocksEachUrl.liveview.py—ENCODINGSdatetime.time.dt_time: lambda o: {'_': ['time', str(o)]}.hypergen.py—plugins_exit_stackplugin.context()regardless of the requestedmethod_name..context()even when asked for a different plugin method.stack.enter_context(getattr(plugin, method_name)()).context.py— nested-context update guardif not new_value_at:treated a legitimately emptypmapas the "not immutable" failure (emptypmapis falsy).context()where the merged result was an emptypmapwrongly raisedTypeError("Not immutable context variable…").if new_value_at is None:so only a realdict.update()→Noneindicates a mutable value.Tooling/dev-env bug (not in the library)
tasks/mise-uv-init.py#!/usr/bin/env python3shebang. During mise's env evaluation,env python3resolves to mise's own shim, re-entering mise.miseexhausts process limits (os error 11) before any virtual environment exists./bin/sh+ Python bootstrap that re-execs under the first real systempython3(plus aruff.tomlE402per-file ignore).