John Vandenberg has uploaded a new change for review.
https://gerrit.wikimedia.org/r/159410
Change subject: Use relative import of upload in data_ingestion
......................................................................
Use relative import of upload in data_ingestion
py3 nosetests fails on 'import upload' in the
data_ingestion script, causing a travis build breakage.
Two other scripts use 'import upload'
- flickrripper
- imagetransfer
And other use 'import <script>' syntax, which will
also fail on py3 nosetests.
This change only updates data_ingestion to use
the 'from scripts import upload' import style.
Also update data_ingestion tests to use test metaclass.
Change-Id: If40087657718749dd54a37834d551f97424b4914
---
M scripts/data_ingestion.py
M tests/data_ingestion_tests.py
2 files changed, 12 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/10/159410/1
diff --git a/scripts/data_ingestion.py b/scripts/data_ingestion.py
index 83ec1c0..ec19ead 100755
--- a/scripts/data_ingestion.py
+++ b/scripts/data_ingestion.py
@@ -15,7 +15,7 @@
import sys
import pywikibot
-import upload
+from scripts import upload
if sys.version_info[0] > 2:
from urllib.parse import urlparse
diff --git a/tests/data_ingestion_tests.py b/tests/data_ingestion_tests.py
index 8a877e3..741ccef 100644
--- a/tests/data_ingestion_tests.py
+++ b/tests/data_ingestion_tests.py
@@ -5,12 +5,16 @@
__version__ = '$Id$'
import os
-from tests import unittest
+from tests.aspects import unittest, TestCase
from scripts import data_ingestion
-class TestPhoto(unittest.TestCase):
+class TestPhoto(TestCase):
+
+ net = True
+
def setUp(self):
+ super(TestPhoto, self).setUp()
self.obj =
data_ingestion.Photo(URL='http://upload.wikimedia.org/wikipedia/commons/f/fc/MP_sounds.png',
metadata={'description.en': '"Sounds"
icon',
'source':
'http://commons.wikimedia.org/wiki/File:Sound-icon.svg',
@@ -43,8 +47,12 @@
}}""") # noqa
-class TestCSVReader(unittest.TestCase):
+class TestCSVReader(TestCase):
+
+ net = False
+
def setUp(self):
+ super(TestCSVReader, self).setUp()
fileobj = open(os.path.join(os.path.split(__file__)[0], 'data',
'csv_ingestion.csv'))
self.iterator = data_ingestion.CSVReader(fileobj, 'url')
self.obj = next(self.iterator)
--
To view, visit https://gerrit.wikimedia.org/r/159410
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If40087657718749dd54a37834d551f97424b4914
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits