File: Fix-standalone-tests-module.patch

package info (click to toggle)
python-arrayfire 3.3.20160624-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 764 kB
  • ctags: 826
  • sloc: python: 3,999; makefile: 205
file content (56 lines) | stat: -rw-r--r-- 1,600 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From: Ghislain Antony Vaillant <ghisvail@gmail.com>
Date: Fri, 16 Sep 2016 09:56:01 +0100
Subject: Fix standalone tests module.

---
 tests/__init__.py     | 8 ++++++++
 tests/__main__.py     | 4 +++-
 tests/simple_tests.py | 4 +++-
 3 files changed, 14 insertions(+), 2 deletions(-)
 create mode 100644 tests/__init__.py

diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..be76698
--- /dev/null
+++ b/tests/__init__.py
@@ -0,0 +1,8 @@
+#######################################################
+# Copyright (c) 2015, ArrayFire
+# All rights reserved.
+#
+# This file is distributed under 3-clause BSD license.
+# The complete license agreement can be obtained at:
+# http://arrayfire.com/licenses/BSD-3-Clause
+########################################################
diff --git a/tests/__main__.py b/tests/__main__.py
index 5b1e473..4683965 100644
--- a/tests/__main__.py
+++ b/tests/__main__.py
@@ -7,8 +7,10 @@
 # http://arrayfire.com/licenses/BSD-3-Clause
 ########################################################
 
+from __future__ import absolute_import
+
 import sys
-from simple_tests import *
+from .simple_tests import *
 
 tests = {}
 tests['simple'] = simple.tests
diff --git a/tests/simple_tests.py b/tests/simple_tests.py
index 370b162..603ae9f 100755
--- a/tests/simple_tests.py
+++ b/tests/simple_tests.py
@@ -9,7 +9,9 @@
 # http://arrayfire.com/licenses/BSD-3-Clause
 ########################################################
 
-import simple
+from __future__ import absolute_import
+
+from . import simple
 import sys
 
 if __name__ == "__main__":