do checks first
This commit is contained in:
parent
53b112ff3e
commit
44705b622b
3 changed files with 12 additions and 9 deletions
|
|
@ -62,6 +62,8 @@ class Script:
|
|||
self._ensure_no_cycle(
|
||||
name=variable_name, dep=dep.name, deps=deps, definitions=self._variables
|
||||
)
|
||||
if dep.name not in self._variables:
|
||||
print("h")
|
||||
self._traverse_variable_dependencies(
|
||||
variable_name=variable_name,
|
||||
variable_dependency=self._variables[dep.name],
|
||||
|
|
|
|||
|
|
@ -251,14 +251,6 @@ def _validate_formatter(
|
|||
variable_names = {var.name for var in parsed.variables}
|
||||
custom_function_names = {f"%{func.name}" for func in parsed.custom_functions}
|
||||
|
||||
if resolve_partial and not is_static_formatter:
|
||||
formatter_hash = get_md5_hash(formatter_validator.format_string)
|
||||
|
||||
parsed = mock_script.resolve_partial_once(
|
||||
variable_definitions={formatter_hash: formatter_validator.parsed},
|
||||
unresolvable=unresolved_variables,
|
||||
)[formatter_hash]
|
||||
|
||||
# Add lambda functions to custom function names, if it's custom
|
||||
for lambda_func in parsed.lambdas:
|
||||
if lambda_func in mock_script.function_names:
|
||||
|
|
@ -279,6 +271,15 @@ def _validate_formatter(
|
|||
"contains the following variables that are unresolved when executing this "
|
||||
f"formatter: {', '.join(sorted(unresolved))}"
|
||||
)
|
||||
|
||||
if resolve_partial and not is_static_formatter:
|
||||
formatter_hash = get_md5_hash(formatter_validator.format_string)
|
||||
|
||||
parsed = mock_script.resolve_partial_once(
|
||||
variable_definitions={formatter_hash: formatter_validator.parsed},
|
||||
unresolvable=unresolved_variables,
|
||||
)[formatter_hash]
|
||||
|
||||
try:
|
||||
if is_static_formatter:
|
||||
return mock_script.resolve_once_parsed(
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from pathlib import Path
|
|||
from typing import Dict
|
||||
|
||||
DISABLE_YOUTUBE_TESTS: bool = True
|
||||
REGENERATE_FIXTURES: bool = True
|
||||
REGENERATE_FIXTURES: bool = False
|
||||
|
||||
RESOURCE_PATH: Path = Path("tests") / "resources"
|
||||
_FILE_FIXTURE_PATH: Path = RESOURCE_PATH / "file_fixtures"
|
||||
|
|
|
|||
Loading…
Reference in a new issue