Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

setup Travis-CI by adding a .travis.yml file. Add pytest to requirements.txt. Add a couple of dummy tests for now.

leotrs705b960f7072
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000..86f6822a4
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,25 @@
+language: python
+
+python:
+ - "3.6"
+ - "3.7"
+ - "3.8"
+
+os:
+ - linux
+ - osx
+ - windows
+
+# command to install dependencies
+install:
+ - pip install -r requirements.txt
+ - pip install .
+
+# command to run tests
+script:
+ - pytest
+
+# branches that trigger Travis builds
+branches:
+ only:
+ - travis-setup
diff --git a/requirements.txt b/requirements.txt
index 7dec25c9b..45cea631f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -11,3 +11,4 @@ pydub
pygments
pyreadline; sys_platform == 'win32',
rich
+pytest
diff --git a/tests/test_imports.py b/tests/test_imports.py
new file mode 100644
index 000000000..4bb8824f3
--- /dev/null
+++ b/tests/test_imports.py
@@ -0,0 +1,2 @@
+def test_import():
+ import manim.imports
diff --git a/tests/tests_sample_scenes.py b/tests/test_sample_scenes.py
similarity index 85%
rename from tests/tests_sample_scenes.py
rename to tests/test_sample_scenes.py
index 438568822..0cddf211a 100644
--- a/tests/tests_sample_scenes.py
+++ b/tests/test_sample_scenes.py
@@ -1,13 +1,14 @@
from manim.imports import *
-# This file is intended to test any new feature added.
-# Feel free to add a test or to modify one when adding a new/changing a feature.
-class Test(Scene):
- def construct(self):
+# This file is intended to test any new feature added.
+# Feel free to add a test or to modify one when adding a new/changing a feature.
+class BasicScene(Scene):
+ def construct(self):
square = Square()
self.play(ShowCreation(square))
-
-class Test_geometry(Scene):
+
+
+class GeometryScene(Scene):
def construct(self):
circle = Circle()
square = Square()
@@ -39,7 +40,8 @@ class Test_geometry(Scene):
)
self.wait()
-class Test_plotting(GraphScene):
+
+class PlottingScene(GraphScene):
CONFIG = {
"x_min" : -10,
"x_max" : 10.3,
@@ -49,8 +51,12 @@ class Test_plotting(GraphScene):
"function_color" : RED ,
"axes_color" : GREEN,
"x_labeled_nums" :range(-10,12,2),
- }
- def construct(self):
+ }
+ def construct(self):
self.setup_axes(animate=False)
func_graph = self.get_graph(lambda x : x**2, self.function_color)
self.play(ShowCreation(func_graph))
+
+
+def test_scenes():
+ BasicScene()