Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ exclude_also = [
'class .*\bProtocol\b.*\):',
"raise NotImplementedError",
'.*if "sphinx" in sys.modules:',
'TODO: test this line'
'TODO: test this line',
'if __name__ == "__main__":',
Comment thread
A5rocks marked this conversation as resolved.
]
partial_branches = [
"pragma: no branch",
Expand Down
1 change: 1 addition & 0 deletions src/trio/_tests/tools/test_sync_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def test_yield_pre_commit_version_data() -> None:
rev: v0.11.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.1.0
- bad: data
"""
results = tuple(yield_pre_commit_version_data(text))
assert results == (
Expand Down
2 changes: 1 addition & 1 deletion src/trio/_tools/gen_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,5 +399,5 @@ def main() -> None: # pragma: no cover
"""


if __name__ == "__main__": # pragma: no cover
if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion src/trio/_tools/mypy_annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,5 @@ def main(argv: list[str]) -> None:
pickle.dump(results, f)


if __name__ == "__main__": # pragma: no cover
if __name__ == "__main__":
main(sys.argv[1:])
10 changes: 2 additions & 8 deletions src/trio/_tools/sync_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ def update_requirements(
return changed


def main() -> int:
"""Run program."""

if __name__ == "__main__":
source_root = Path.cwd().absolute()

# Double-check we found the right directory
Expand All @@ -97,8 +95,4 @@ def main() -> int:
for name, version in yield_pre_commit_version_data(pre_commit_text)
}
changed = update_requirements(test_requirements, pre_commit_versions)
return int(changed)


if __name__ == "__main__":
sys.exit(main())
sys.exit(int(changed))
Loading