[Patchew-devel] [PATCH v2] testcases: use full path when importing patchewtest

Paolo Bonzini posted 1 patch 24 weeks ago
Failed in applying to current master (apply log)
tests/test_diff.py    | 2 +-
tests/test_git.py     | 2 +-
tests/test_import.py  | 2 +-
tests/test_mbox.py    | 2 +-
tests/test_message.py | 2 +-
tests/test_model.py   | 2 +-
tests/test_project.py | 2 +-
tests/test_rest.py    | 2 +-
tests/test_tags.py    | 2 +-
tests/test_testing.py | 2 +-
10 files changed, 10 insertions(+), 10 deletions(-)

[Patchew-devel] [PATCH v2] testcases: use full path when importing patchewtest

Posted by Paolo Bonzini 24 weeks ago
The actual path to patchewtest is tests.patchewtest; "from patchewtest"
breaks when invoking "./manage.py test tests.test_project".  However,
the relative path "from .patchewtest" breaks when invoking
"./manage.py test tests".

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/test_diff.py    | 2 +-
 tests/test_git.py     | 2 +-
 tests/test_import.py  | 2 +-
 tests/test_mbox.py    | 2 +-
 tests/test_message.py | 2 +-
 tests/test_model.py   | 2 +-
 tests/test_project.py | 2 +-
 tests/test_rest.py    | 2 +-
 tests/test_tags.py    | 2 +-
 tests/test_testing.py | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/test_diff.py b/tests/test_diff.py
index 735c4e7..5aaf543 100755
--- a/tests/test_diff.py
+++ b/tests/test_diff.py
@@ -11,7 +11,7 @@
 import sys
 import os
 sys.path.append(os.path.dirname(__file__))
-from patchewtest import PatchewTestCase, main
+from tests.patchewtest import PatchewTestCase, main
 
 class DiffTest(PatchewTestCase):
 
diff --git a/tests/test_git.py b/tests/test_git.py
index d64f901..e3da71f 100755
--- a/tests/test_git.py
+++ b/tests/test_git.py
@@ -11,7 +11,7 @@
 import sys
 import os
 sys.path.append(os.path.dirname(__file__))
-from patchewtest import PatchewTestCase, main
+from tests.patchewtest import PatchewTestCase, main
 import shutil
 import subprocess
 from api.models import Message
diff --git a/tests/test_import.py b/tests/test_import.py
index 3ad7592..5693d7e 100755
--- a/tests/test_import.py
+++ b/tests/test_import.py
@@ -11,7 +11,7 @@
 import sys
 import os
 sys.path.append(os.path.dirname(__file__))
-from patchewtest import PatchewTestCase, main
+from tests.patchewtest import PatchewTestCase, main
 import json
 from api.models import Message, Project
 
diff --git a/tests/test_mbox.py b/tests/test_mbox.py
index b63608d..f003844 100755
--- a/tests/test_mbox.py
+++ b/tests/test_mbox.py
@@ -12,7 +12,7 @@ import os
 import sys
 import mbox
 sys.path.append(os.path.dirname(__file__))
-from patchewtest import PatchewTestCase, main
+from tests.patchewtest import PatchewTestCase, main
 
 class MboxTest(PatchewTestCase):
 
diff --git a/tests/test_message.py b/tests/test_message.py
index 8f2f75e..9448aee 100755
--- a/tests/test_message.py
+++ b/tests/test_message.py
@@ -10,7 +10,7 @@
 
 import time
 import datetime
-from patchewtest import PatchewTestCase, main
+from tests.patchewtest import PatchewTestCase, main
 
 class ProjectTest(PatchewTestCase):
 
diff --git a/tests/test_model.py b/tests/test_model.py
index 30cb409..1464df2 100755
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -8,7 +8,7 @@
 # This work is licensed under the MIT License.  Please see the LICENSE file or
 # http://opensource.org/licenses/MIT.
 
-from patchewtest import PatchewTestCase, main
+from tests.patchewtest import PatchewTestCase, main
 from api.models import Message
 
 class ImportTest(PatchewTestCase):
diff --git a/tests/test_project.py b/tests/test_project.py
index eb06050..fbc1f0e 100755
--- a/tests/test_project.py
+++ b/tests/test_project.py
@@ -8,7 +8,7 @@
 # This work is licensed under the MIT License.  Please see the LICENSE file or
 # http://opensource.org/licenses/MIT.
 
-from patchewtest import PatchewTestCase, main
+from tests.patchewtest import PatchewTestCase, main
 
 class ProjectTest(PatchewTestCase):
 
diff --git a/tests/test_rest.py b/tests/test_rest.py
index fa10921..980d61a 100755
--- a/tests/test_rest.py
+++ b/tests/test_rest.py
@@ -16,7 +16,7 @@ import unittest
 from django.contrib.auth.models import User
 
 sys.path.append(os.path.dirname(__file__))
-from patchewtest import PatchewTestCase, main
+from tests.patchewtest import PatchewTestCase, main
 from api.models import Message
 from api.rest import AddressSerializer
 from collections import OrderedDict
diff --git a/tests/test_tags.py b/tests/test_tags.py
index 8469c42..6c162de 100755
--- a/tests/test_tags.py
+++ b/tests/test_tags.py
@@ -11,7 +11,7 @@
 import sys
 import os
 sys.path.append(os.path.dirname(__file__))
-from patchewtest import PatchewTestCase, main
+from tests.patchewtest import PatchewTestCase, main
 
 class ImportTest(PatchewTestCase):
 
diff --git a/tests/test_testing.py b/tests/test_testing.py
index 8f831a1..989ccd1 100755
--- a/tests/test_testing.py
+++ b/tests/test_testing.py
@@ -13,7 +13,7 @@ import sys
 import os
 import subprocess
 sys.path.append(os.path.dirname(__file__))
-from patchewtest import PatchewTestCase, main
+from tests.patchewtest import PatchewTestCase, main
 from api.models import Message
 
 def create_test(project, name):
-- 
2.17.1

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel