fix: add readme tests + doc dry run#827
Conversation
…braket-examples into add-readme-tests
This reverts commit 420768a.
| @pytest.fixture(autouse=True) | ||
| def restore_cwd(): | ||
| original_cwd = os.getcwd() | ||
| yield |
There was a problem hiding this comment.
Out of curiosity, why is this needed?
There was a problem hiding this comment.
Here, every time chdir is called it moves, the working directory moves, which is why it effectively is reset at the beginning of each test. here you could just remove that line from each test I believe. the problem would be when this notebook is not run last, that it affects repo_test, but it's not consistent with pytest or os.
Actually might need to adjust it slightly.
There was a problem hiding this comment.
Cleaned it up, but it's a minor point - previously it would have moved at the beginning of each test, here we just move back at the end.
|
|
||
| try: | ||
| os.chdir(root_path) | ||
| sys.path.insert(0, str(root_path / "docs")) |
There was a problem hiding this comment.
I did not know this syntax worked
There was a problem hiding this comment.
Same until today 😅
Issue #, if available:
Currently no error if new notebooks are still just added to the README.md; which circumvents the doc build. This adds appropriate tests.
Close #802
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.