Browse code

make tests a proper package and add pytest config

Joseph Weston authored on 27/10/2017 13:07:30 • Bas Nijholt committed on 20/11/2017 15:49:57
Showing 3 changed files
1 1
new file mode 100644
2 2
similarity index 76%
3 3
rename from adaptive/tests/test_leaner.py
4 4
rename to adaptive/tests/test_learner.py
... ...
@@ -1,8 +1,10 @@
1 1
 # -*- coding: utf-8 -*-
2
-import adaptive
3 2
 
4
-def test_neigbors():
5
-    learner = adaptive.learner.Learner1D(lambda x: x, bounds=(-1.0, 1.0))
3
+from ..learner import Learner1D
4
+
5
+
6
+def test_neighbors():
7
+    learner = Learner1D(lambda x: x, bounds=(-1.0, 1.0))
6 8
     learner.add_data([-1, 1], [-1, 1])
7 9
     assert learner.neighbors == {-1: [None, 1], 1: [-1, None]}
8 10
     learner.choose_points(1, False)
9 11
new file mode 100644
... ...
@@ -0,0 +1,2 @@
1
+[pytest]
2
+testpaths = adaptive