diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..cac7314 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +mappings-3.7.2 diff --git a/.travis.yml b/.travis.yml index 161840a..518cb59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: trusty +dist: xenial services: - postgresql addons: @@ -6,7 +6,7 @@ addons: language: python cache: pip python: - - '2.7' + - '3.7' install: - pip install -r requirements.txt - pip install coveralls diff --git a/README.rst b/README.rst index 281a7f3..767ca65 100644 --- a/README.rst +++ b/README.rst @@ -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 diff --git a/mappings/__init__.py b/mappings/__init__.py index 9d4c595..f7d350b 100644 --- a/mappings/__init__.py +++ b/mappings/__init__.py @@ -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: diff --git a/requirements.txt b/requirements.txt index 58db4a8..2ddef77 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 \ No newline at end of file diff --git a/tests/test_hybrid_expressions.py b/tests/test_hybrid_expressions.py index 5a2ebc2..e45976e 100644 --- a/tests/test_hybrid_expressions.py +++ b/tests/test_hybrid_expressions.py @@ -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():