Skip to content

Commit

Permalink
test: examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jkjkil4 committed Aug 1, 2024
1 parent 60ea6d5 commit db9aea0
Show file tree
Hide file tree
Showing 54 changed files with 823 additions and 36 deletions.
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[run]
source = janim
omit =
janim/gui/*
janim/locale/*
8 changes: 4 additions & 4 deletions janim/render/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def __init__(self, anim: TimelineAnim):
)
)

@staticmethod
def writes(anim: TimelineAnim, file_path: str, *, quiet=False) -> None:
VideoWriter(anim).write_all(file_path, quiet=quiet)

def write_all(self, file_path: str, *, quiet=False) -> None:
'''将时间轴动画输出到文件中
Expand Down Expand Up @@ -137,10 +141,6 @@ def close_video_pipe(self) -> None:
self.writing_process.terminate()
shutil.move(self.temp_file_path, self.final_file_path)

@staticmethod
def writes(anim: TimelineAnim, file_path: str, *, quiet=False) -> None:
VideoWriter(anim).write_all(file_path, quiet=quiet)


class AudioWriter:
def __init__(self, anim: TimelineAnim):
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ doc = [
exclude = [
".vscode/", ".github/", "assets/", "doc/", "test/",
".pypirc",
".coveragerc",
"janim/gui/*.ui",
"janim/locale/source",
"janim/locale/compile.py",
"janim/locale/gettext.py",
Expand Down
13 changes: 13 additions & 0 deletions test/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import unittest


def main() -> None:
test_loader = unittest.TestLoader()
test_suite = test_loader.discover('test', pattern='test_*.py')

test_runner = unittest.TextTestRunner(verbosity=2, buffer=True)
test_runner.run(test_suite)


if __name__ == '__main__':
main()
Empty file added test/examples/__init__.py
Empty file.
Loading

0 comments on commit db9aea0

Please sign in to comment.