Added PyTest, Fixes a line duplication bug with YT live translation .vtt#10
Merged
NebularNerd merged 8 commits intomainfrom Feb 8, 2025
Merged
Added PyTest, Fixes a line duplication bug with YT live translation .vtt#10NebularNerd merged 8 commits intomainfrom
NebularNerd merged 8 commits intomainfrom
Conversation
Added a basic pytest, will build more later if this works. Fixed a line duplication bug for certain files.
to match black
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9
Line duplication bug
Per issue above, @rajibando reported that lines were being duplicated, a friend of theirs fixed it and upon testing it appears that the issue was from some extra junk being left behind when dealing with YouTube live translated subtitles. Code snippet from issue fixes this and after a couple of tweaks elsewhere behaves well with all files.
The subtitle is now in my test files so once I've built better pytest's it will be checked automatically in the future.
YT Auto Translate test file
Flake8 Quote Marks
More Flake8 tweaks and fixes, weirdly while Flake8 on my system and in VSC was happy with double quotes, the GitHub Marketplace one wanted single.
Docstrings
We now have docstrings, the Flake8 plugin also tests for this, rather than be lazy and tell it not too I've added some in. This will help others and future me know what's going on.
Pytest
Finally understand (mostly) how pytest works, only one test for the moment but it's enough to quickly confirm the script runs. As github is x64 only we cannot test Python versions below 3.9.
Other tweaks and fixes
Lots of other little fixes, including most importantly using the classes correctly.