Skip to content

Added PyTest, Fixes a line duplication bug with YT live translation .vtt#10

Merged
NebularNerd merged 8 commits intomainfrom
dev
Feb 8, 2025
Merged

Added PyTest, Fixes a line duplication bug with YT live translation .vtt#10
NebularNerd merged 8 commits intomainfrom
dev

Conversation

@NebularNerd
Copy link
Owner

@NebularNerd NebularNerd commented Feb 7, 2025

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.

@NebularNerd NebularNerd changed the title Added initially pytest, fixed line bug Added PyTest, Fixes a line duplication bug with YT live translation .vtt Feb 8, 2025
@NebularNerd NebularNerd marked this pull request as ready for review February 8, 2025 08:56
@NebularNerd NebularNerd merged commit 0b848b9 into main Feb 8, 2025
9 checks passed
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.

Output Text file contains 3 of each line, change required

1 participant