You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docstrings generation was requested by @laike9m.
* #98 (comment)
The following files were modified:
* `tests/assets/challenges/basic-foo-pyright-config/question.py`
* `tests/conftest.py`
* `tests/test_identical.py`
* `views/challenge.py`
* `views/views.py`
Checks that the test code embedded in the given solution file matches the test code in the corresponding question file.
13
+
14
+
Reads the solution file to construct a Challenge object (using the solution file's parent directory name to derive level and challenge name), extracts each challenge's test code up to the marker "\n## End of test code ##\n", strips surrounding whitespace, and asserts the two extracted test code segments are equal.
15
+
16
+
Parameters:
17
+
solution_file (Path): Path to the solution file whose test code will be compared to the question file located at the same directory with name "question.py".
Split test code from an optional Pyright configuration block and return the test portion plus the effective Pyright configuration.
179
+
180
+
Parameters:
181
+
test_code (str): Combined test code that may include a separator line "\n## End of test code ##\n" followed by additional Pyright configuration.
182
+
183
+
Returns:
184
+
tuple[str, str]: A tuple (test_code, pyright_basic_config) where `test_code` is the portion before the splitter and `pyright_basic_config` is the base PYRIGHT_BASIC_CONFIG optionally extended with any config found after the splitter.
185
+
"""
186
+
TEST_SPLITTER="\n## End of test code ##\n"
187
+
188
+
# PYRIGHT_BASIC_CONFIG aim to limit user to modify the config
Render the challenge page or HTMX component for a given challenge.
58
+
59
+
Builds the template context for the challenge identified by level and name, including the user's code under test, the test code truncated at the "\n## End of test code ##\n" marker, rendered hints (when present), challenges grouped by level, and Python runtime information. Returns the HTMX component template when HTMX is active; otherwise returns the full challenge page template.
60
+
61
+
Returns:
62
+
Flask response: Rendered HTML response for the requested challenge page or HTMX component.
0 commit comments