Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
python -m pip install --upgrade pip wheel
pip install -r requirements_dev.txt
- name: Run tests
run: nosetests iati_datastore --with-coverage --cover-package iati_datastore/iatilib
run: coverage run -m pytest
- name: Coveralls
run: coveralls
env:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ htmlcov/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ git clone https://github.com/codeforIATI/iati-datastore.git
pip install -r requirements_dev.txt

# Run the tests (these tests use an in-memory sqlite db)
nosetests iati_datastore
pytest

# Create a new PostgreSQL database
sudo -u postgres psql -c "CREATE DATABASE iati_datastore"
Expand Down Expand Up @@ -88,7 +88,7 @@ A Vagrant box is also provided. `vagrant up` as normal, then `vagrant ssh`.

```
# Run the tests (these tests use an in-memory sqlite db)
nosetests iati_datastore
pytest

# Create the db tables
iati db upgrade
Expand Down
18 changes: 9 additions & 9 deletions iati_datastore/iatilib/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def reporting_org(element, resource=no_resource, major_version='1'):
except (MissingValue, ValueError) as exe:
data['type'] = None
iati_identifier = xval(xml, "/iati-identifier/text()", 'no_identifier')
log.warn(
log.warning(
_(u"Failed to import a valid reporting-org.type in activity {0}, error was: {1}".format(
iati_identifier, exe),
logger='activity_importer', dataset=resource.dataset_id, resource=resource.url),
Expand All @@ -152,7 +152,7 @@ def participating_orgs(xml, resource=None, major_version='1'):
ret.append(Participation(role=role, organisation=organisation))
except ValueError as e:
iati_identifier = xval(xml, "/iati-activity/iati-identifier/text()", 'no_identifier')
log.warn(
log.warning(
_(u"Failed to import a valid sector percentage:{0} in activity {1}, error was: {2}".format(
'organisation_role', iati_identifier, e),
logger='activity_importer', dataset=resource.dataset_id, resource=resource.url),
Expand Down Expand Up @@ -253,7 +253,7 @@ def process(ele):
except (MissingValue, InvalidDateError, ValueError, InvalidOperation) as exe:
data[field] = None
iati_identifier = xval(xml, "/iati-activity/iati-identifier/text()", 'no_identifier')
log.warn(
log.warning(
_(u"Failed to import a valid {0} in activity {1}, error was: {2}".format(
field, iati_identifier, exe),
logger='activity_importer', dataset=resource.dataset_id, resource=resource.url),
Expand All @@ -268,7 +268,7 @@ def process(ele):
ret.append(process(ele))
except MissingValue as exe:
iati_identifier = xval(xml, "/iati-identifier/text()", 'no_identifier')
log.warn(
log.warning(
_(u"Failed to import a valid transaction in activity {0}, error was: {1}".format(
iati_identifier, exe),
logger='activity_importer', dataset=resource.dataset_id, resource=resource.url),
Expand All @@ -292,7 +292,7 @@ def sector_percentages(xml, resource=no_resource, major_version='1'):
setattr(sp, field, function(ele, resource))
except (MissingValue, ValueError) as exe:
iati_identifier = xval(xml, "/iati-activity/iati-identifier/text()", 'no_identifier')
log.warn(
log.warning(
_("uFailed to import a valid {0} in activity {1}, error was: {2}".format(
field, iati_identifier, exe),
logger='activity_importer', dataset=resource.dataset_id, resource=resource.url),
Expand Down Expand Up @@ -338,7 +338,7 @@ def process(ele):
except (MissingValue, InvalidDateError, ValueError, InvalidOperation) as exe:
data[field] = None
iati_identifier = xval(xml, "/iati-activity/iati-identifier/text()", 'no_identifier')
log.warn(
log.warning(
_("uFailed to import a valid budget:{0} in activity {1}, error was: {2}".format(
field, iati_identifier, exe),
logger='activity_importer', dataset=resource.dataset_id, resource=resource.url),
Expand Down Expand Up @@ -372,7 +372,7 @@ def related_activities(xml, resource=no_resource, major_version='1'):
results.append(RelatedActivity(ref=ref, text=text))
except MissingValue as e:
iati_identifier = xval(xml, "/iati-activity/iati-identifier/text()", 'no_identifier')
log.warn(
log.warning(
_(u"Failed to import a valid related-activity in activity {0}, error was: {1}".format(
iati_identifier, e),
logger='activity_importer', dataset=resource.dataset_id, resource=resource.url),
Expand Down Expand Up @@ -410,7 +410,7 @@ def from_codelist(codelist, path, xml, resource=no_resource):
xml, "/iati-activity/iati-identifier/text()",
'no_identifier')

log.warn(
log.warning(
_((u"Failed to import a valid {0} in activity"
"{1}, error was: {2}".format(codelist, iati_identifier, e)),
logger='activity_importer',
Expand Down Expand Up @@ -496,7 +496,7 @@ def activity(xml, resource=no_resource, major_version='1', version=None):
data[field] = []
else:
data[field] = None
log.warn(
log.warning(
_(u"Failed to import a valid {0} in activity {1}, error was: {2}".format(
field, data['iati_identifier'], exe),
logger='activity_importer', dataset=resource.dataset_id, resource=resource.url),
Expand Down
Loading