Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable doctest #5742

Merged
merged 11 commits into from
Jul 13, 2022
11 changes: 6 additions & 5 deletions dev_tools/docs/run_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ def exec_tests(
failed, attempted = 0, 0
error_messages = []
for test in tests:
print(test.file_name)
out = OutputCapture()
with out:
r = test.run()
Expand Down Expand Up @@ -230,17 +229,19 @@ def main():
'cirq-google/cirq_google/cloud/',
'cirq-google/cirq_google/api',
Copy link
Collaborator

@pavoljuhas pavoljuhas Jul 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be on a safe side - let's replace api --> api/ as for above paths.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

]
file_names = [f for f in file_names if not any(f.startswith(x) for x in excluded)]
file_names = [
f
for f in file_names
if not (any(f.startswith(x) for x in excluded) or f.endswith("_test.py"))
]
failed, attempted = run_tests(
file_names, include_modules=True, include_local=False, quiet=quiet
)

if failed != 0:
print(
shell_tools.highlight(
'Failed: {} failed, {} passed, {} total'.format(
failed, attempted - failed, attempted
),
f'Failed: {failed} failed, {attempted - failed} passed, {attempted} total',
shell_tools.RED,
)
)
Expand Down