-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #797 from expectedparrot/serialization
Comment out results breakpoint
- Loading branch information
Showing
3 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import os | ||
import re | ||
from edsl import BASE_DIR | ||
|
||
|
||
def test_no_breakpoint(): | ||
breakpoint_pattern = re.compile(r"\bbreakpoint\(\)") | ||
for root, _, files in os.walk(BASE_DIR): | ||
for file in files: | ||
if file.endswith(".py"): | ||
file_path = os.path.join(root, file) | ||
with open(file_path, "r", encoding="utf-8") as f: | ||
for lineno, line in enumerate(f, start=1): | ||
stripped_line = line.strip() | ||
# Skip lines that are comments | ||
if stripped_line.startswith("#"): | ||
continue | ||
# Check if the pattern is found in the line | ||
if breakpoint_pattern.search(line): | ||
assert ( | ||
False | ||
), f"Found 'breakpoint()' in {file_path} on line {lineno}" |