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

Update draft directory, lint tests so each test has only one lint error #648

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

vr8hub
Copy link
Contributor

@vr8hub vr8hub commented Feb 17, 2024

As discussed.

  1. An updated draft directory that contains enough files and metadata for a clean lint.
  2. Updated lint tests and golden files to test one error each. These tests are the ones that were already present (IOW no new tests yet), but three of them were renamed to represent the actual error they were testing.
  3. The test input files were also updated so that only one error was tested. E.g., the former glossary, now s-062, test was generating an s-007 error, but that was already tested (for glossary) in the s-007 test.
  4. The test labeled s-058 was actually testing s-056, so has been renamed.
  5. The test_lint.py function had a hard-coded pytest.mark.parametrize call with each of the test names. That would obviously not scale very well, so I modified it to get the subdirectory names and use that list for the call. Not only does it solve the scale issue, but we don't have to remember to update the call every time we add a new test.
  6. I modified the assemble_ebook function to, if the directory containing the test input files contains a subdirectory, do a copytree instead of manually copying the files. This allows existing (or new) tests that just need to copy a file or two to continue to work as before, but if we need to copy files in multiple levels of the ebook tree, allows us to do so easily.

A pytest locally runs without errors.

@acabal acabal merged commit bebf62b into standardebooks:master Feb 19, 2024
1 check passed
@acabal
Copy link
Member

acabal commented Feb 19, 2024

Great, thanks!

@vr8hub vr8hub deleted the update_linttests branch February 19, 2024 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants