Skip to content
Merged
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
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mappings-3.7.2
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dist: trusty
dist: xenial
services:
- postgresql
addons:
postgresql: "9.5"
language: python
cache: pip
python:
- '2.7'
- '3.7'
install:
- pip install -r requirements.txt
- pip install coveralls
Expand Down
10 changes: 10 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
sqlalchemy-mappings
===================

Running
-------

This project uses Python 3.7 installed using the Pyenv tool.

Testing
-------

Tests are run using pytest.


.. |Build Status| image:: https://travis-ci.org/multiplechoice/sqlalchemy-mappings.svg?branch=master
:target: https://travis-ci.org/multiplechoice/sqlalchemy-mappings
Expand Down
2 changes: 1 addition & 1 deletion mappings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def spider(self):
we get a None instead.

Returns:
basestring or None: the name of the spider
string or None: the name of the spider

"""
if self.data is None or 'spider' not in self.data:
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
python-dateutil==2.8.0
psycopg2==2.7.7
SQLAlchemy==1.2.18
pytest==4.3.0
SQLAlchemy==1.3.1
pytest==4.4.0
pytest-cov==2.6.1
4 changes: 2 additions & 2 deletions tests/test_hybrid_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ def test_find_by_spider():
def test_as_dict():
with session_scope(FARAH) as session:
job = session.query(ScrapedJob).filter(ScrapedJob.spider == 'tarantula').one()
for key, value in example_data[0].iteritems():
for key, value in example_data[0].items():
assert key in job.as_dict()
assert job.as_dict()[key] == value

for key in ('created_at', 'last_modified', 'id'):
assert key in job.as_dict()
assert isinstance(job.as_dict()[key], basestring)
assert isinstance(job.as_dict()[key], str)


def test_date_of_posting():
Expand Down