Fix logging
This commit is contained in:
@@ -168,6 +168,40 @@ class CliLazyImportTests(unittest.TestCase):
|
||||
result["modules"],
|
||||
)
|
||||
|
||||
def test_root_debug_flag_parses_without_loading_runtime_modules(self):
|
||||
result = self.run_python(
|
||||
textwrap.dedent(
|
||||
f"""
|
||||
import json
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, {str(SRC_ROOT)!r})
|
||||
|
||||
import ffx.cli
|
||||
|
||||
context = ffx.cli.ffx.make_context(
|
||||
"ffx",
|
||||
["--debug", "help"],
|
||||
resilient_parsing=True,
|
||||
)
|
||||
|
||||
print(json.dumps({{
|
||||
"debug": context.params["debug"],
|
||||
"modules": {{
|
||||
module_name: module_name in sys.modules
|
||||
for module_name in {HEAVY_MODULES!r}
|
||||
}},
|
||||
}}))
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
self.assertTrue(result["debug"])
|
||||
self.assertTrue(
|
||||
all(not is_loaded for is_loaded in result["modules"].values()),
|
||||
result["modules"],
|
||||
)
|
||||
|
||||
def test_convert_cut_option_supports_flag_duration_and_start_duration_forms(self):
|
||||
result = self.run_python(
|
||||
textwrap.dedent(
|
||||
|
||||
Reference in New Issue
Block a user