Skip to content

Fix snippets_test.py::test_can_run_docs_code_snippets #7787

@pavoljuhas

Description

@pavoljuhas

Describe the issue

Problem: Unit test snippets_test.py::test_can_run_docs_code_snippets is supposed to verify Python code snippets in markdown files under the docs directory, but it looks for them in the dev_tools directory instead. Markdown files in dev_tools have no snippets to check so the test is a no-op.

$ pytest --quiet --co dev_tools/snippets_test.py::test_can_run_docs_code_snippets
dev_tools/snippets_test.py::test_can_run_docs_code_snippets[cirq-infra/README.md]
dev_tools/snippets_test.py::test_can_run_docs_code_snippets[triage-party/README.md]
dev_tools/snippets_test.py::test_can_run_docs_code_snippets[ci/README.md]

At the time of its writing in #2307 the snippets_test.py was in the docs directory, but #3227 moved it to dev_tools without adjusting its markdown files search.

Solution: Fix markdown files search in snippets_test.py and fix any issues that pop out in the docs/**/*.md files (some snippets may need to be excluded if it is too much hassle to make them pass).

Tell us the version of Cirq where this happens

1.7.0.dev0 at 53b552c

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueThis issue can be resolved by someone who is not familiar with the codebase. A good starting issue.kind/healthFor CI/testing/release process/refactoring/technical debt itemsno QC knowledge neededWant to contribute to Cirq, but don't know quantum computing? This issue is for you.skill-level/beginnerNo background required, self-contained issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions