diff --git a/.gitignore b/.gitignore index 7bbc71c..8924c2e 100644 --- a/.gitignore +++ b/.gitignore @@ -99,3 +99,6 @@ ENV/ # mypy .mypy_cache/ + +.vscode/ + diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..09008b2 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +api-3.6.8 diff --git a/.travis.yml b/.travis.yml index 76265be..ad9e8d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ -dist: trusty +dist: xenial language: python cache: pip python: - - '2.7' + - '3.7' install: - pip install -r requirements.txt - pip install coveralls diff --git a/app.py b/app.py index 508091d..75f2633 100644 --- a/app.py +++ b/app.py @@ -34,13 +34,13 @@ def valid_date(date): Does a quick check on the date to avoid doing a db dip to get an error we could have avoided Args: - date (basestring): the date input that we're validating + date (string): the date input that we're validating Returns: bool: whether or not we think the given input string is a date or not """ - if not isinstance(date, basestring): + if date is None: return False try: diff --git a/requirements.txt b/requirements.txt index b1a994e..dc261d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,7 @@ Flask==1.0.2 -zappa==0.47.1 +zappa==0.48.2 Flask-Cors==3.0.7 Flask-Compress==1.4.0 -pytest==4.3.0 +pytest==4.4.0 pytest-cov==2.6.1 -git+https://github.com/multiplechoice/sqlalchemy-mappings.git@2e5cab4d771137d42b59bf88fd92b7db6f1dbb3a - +git+https://github.com/multiplechoice/sqlalchemy-mappings.git@17e50cfb97695badb192156ff98c39c07024d0ff diff --git a/tests/test_grouping.py b/tests/test_grouping.py index 386cc50..f7654d8 100644 --- a/tests/test_grouping.py +++ b/tests/test_grouping.py @@ -92,7 +92,7 @@ def test_group_by_spider(): def test_group_when_key_missing(): grouped = group_results(examples, 'this_key_doesnt_exist') - assert grouped.keys() == ['unknown'] + assert list(grouped.keys()) == ['unknown'] assert grouped['unknown'] == examples