diff --git a/gratipay/testing/__init__.py b/gratipay/testing/__init__.py index a90a6af02e..744096b61d 100644 --- a/gratipay/testing/__init__.py +++ b/gratipay/testing/__init__.py @@ -80,7 +80,8 @@ def setUpVCR(cls): information, and you can commit that with your updated tests. """ - cls.vcr_cassette = use_cassette(cls.__name__).__enter__() + cls.vcr_cassette = use_cassette(cls.__name__) + cls.vcr_cassette.__enter__() @classmethod diff --git a/gratipay/utils/__init__.py b/gratipay/utils/__init__.py index 5486849c93..0d6e7c7546 100644 --- a/gratipay/utils/__init__.py +++ b/gratipay/utils/__init__.py @@ -378,7 +378,6 @@ def update_global_stats(website): """, default=(0, 0.0)) website.gnactive = stats[0] website.gtransfer_volume = stats[1] - website.glast_week = last_week(website.db) nbackers = website.db.one(""" SELECT npatrons @@ -397,22 +396,6 @@ def update_global_stats(website): website.support_goal = goal -def last_week(db): - WEDNESDAY, THURSDAY, FRIDAY, SATURDAY = 2, 3, 4, 5 - now = datetime.utcnow() - payday = db.one("SELECT ts_start, ts_end FROM paydays WHERE ts_start > ts_end") - last_week = "last week" - if now.weekday() == THURSDAY: - if payday is not None and payday.ts_end is not None and payday.ts_end.year > 1970: - # Payday is finished for today. - last_week = "today" - elif now.weekday() == FRIDAY: - last_week = "yesterday" - elif now.weekday() == SATURDAY: - last_week = "this past week" - return last_week - - def _execute(this, sql, params=[]): print(sql.strip(), params) super(SimpleCursorBase, this).execute(sql, params) diff --git a/requirements_tests.txt b/requirements_tests.txt index 31d65eaab1..280cc71d64 100644 --- a/requirements_tests.txt +++ b/requirements_tests.txt @@ -1,16 +1,16 @@ -./vendor/py-1.4.12.zip -./vendor/pytest-2.3.4.zip +./vendor/py-1.4.26.tar.gz +./vendor/pytest-2.6.4.tar.gz ./vendor/coverage-3.7.1.tar.gz -./vendor/cov-core-1.14.0.tar.gz -./vendor/pytest-cov-1.6.tar.gz +./vendor/cov-core-1.15.0.tar.gz +./vendor/pytest-cov-1.8.1.tar.gz -./vendor/execnet-1.1.zip ./vendor/pytest-cache-1.0.tar.gz -./vendor/pyflakes-0.7.3.tar.gz -./vendor/mock-0.8.0.tar.gz +./vendor/pyflakes-0.8.1.tar.gz +./vendor/mock-1.0.1.tar.gz ./vendor/PyYAML-3.11.tar.gz -./vendor/contextdecorator-0.10.0.tar.gz -./vendor/vcrpy-1.0.2.tar.gz +./vendor/contextlib2-0.4.0.tar.gz +./vendor/wrapt-1.10.2.tar.gz +./vendor/vcrpy-1.1.3.tar.gz diff --git a/tests/py/test_username_json.py b/tests/py/test_username_json.py index 1ad346b501..da5afe7aae 100644 --- a/tests/py/test_username_json.py +++ b/tests/py/test_username_json.py @@ -1,3 +1,4 @@ +# coding: utf8 from __future__ import print_function, unicode_literals import json diff --git a/vendor/contextdecorator-0.10.0.tar.gz b/vendor/contextdecorator-0.10.0.tar.gz deleted file mode 100644 index 410b89ad89..0000000000 Binary files a/vendor/contextdecorator-0.10.0.tar.gz and /dev/null differ diff --git a/vendor/contextlib2-0.4.0.tar.gz b/vendor/contextlib2-0.4.0.tar.gz new file mode 100644 index 0000000000..a50e82d9c6 Binary files /dev/null and b/vendor/contextlib2-0.4.0.tar.gz differ diff --git a/vendor/cov-core-1.14.0.tar.gz b/vendor/cov-core-1.14.0.tar.gz deleted file mode 100644 index ec9de5bcf1..0000000000 Binary files a/vendor/cov-core-1.14.0.tar.gz and /dev/null differ diff --git a/vendor/cov-core-1.15.0.tar.gz b/vendor/cov-core-1.15.0.tar.gz new file mode 100644 index 0000000000..4ee0c5e093 Binary files /dev/null and b/vendor/cov-core-1.15.0.tar.gz differ diff --git a/vendor/execnet-1.1.zip b/vendor/execnet-1.1.zip deleted file mode 100644 index 9fe2b5ae55..0000000000 Binary files a/vendor/execnet-1.1.zip and /dev/null differ diff --git a/vendor/mock-0.8.0.tar.gz b/vendor/mock-0.8.0.tar.gz deleted file mode 100644 index 4e70b029c7..0000000000 Binary files a/vendor/mock-0.8.0.tar.gz and /dev/null differ diff --git a/vendor/mock-1.0.1.tar.gz b/vendor/mock-1.0.1.tar.gz new file mode 100644 index 0000000000..4fdea77c71 Binary files /dev/null and b/vendor/mock-1.0.1.tar.gz differ diff --git a/vendor/py-1.4.12.zip b/vendor/py-1.4.12.zip deleted file mode 100644 index 850f38b5d4..0000000000 Binary files a/vendor/py-1.4.12.zip and /dev/null differ diff --git a/vendor/py-1.4.26.tar.gz b/vendor/py-1.4.26.tar.gz new file mode 100644 index 0000000000..f7c186c492 Binary files /dev/null and b/vendor/py-1.4.26.tar.gz differ diff --git a/vendor/pyflakes-0.7.3.tar.gz b/vendor/pyflakes-0.7.3.tar.gz deleted file mode 100644 index 65a2a14b4b..0000000000 Binary files a/vendor/pyflakes-0.7.3.tar.gz and /dev/null differ diff --git a/vendor/pyflakes-0.8.1.tar.gz b/vendor/pyflakes-0.8.1.tar.gz new file mode 100644 index 0000000000..a34e15dd47 Binary files /dev/null and b/vendor/pyflakes-0.8.1.tar.gz differ diff --git a/vendor/pytest-2.3.4.zip b/vendor/pytest-2.3.4.zip deleted file mode 100644 index 853bc6b88a..0000000000 Binary files a/vendor/pytest-2.3.4.zip and /dev/null differ diff --git a/vendor/pytest-2.6.4.tar.gz b/vendor/pytest-2.6.4.tar.gz new file mode 100644 index 0000000000..52a5b3106c Binary files /dev/null and b/vendor/pytest-2.6.4.tar.gz differ diff --git a/vendor/pytest-cov-1.6.tar.gz b/vendor/pytest-cov-1.6.tar.gz deleted file mode 100644 index 4e50107c18..0000000000 Binary files a/vendor/pytest-cov-1.6.tar.gz and /dev/null differ diff --git a/vendor/pytest-cov-1.8.1.tar.gz b/vendor/pytest-cov-1.8.1.tar.gz new file mode 100644 index 0000000000..f6b4f50edb Binary files /dev/null and b/vendor/pytest-cov-1.8.1.tar.gz differ diff --git a/vendor/vcrpy-1.0.2.tar.gz b/vendor/vcrpy-1.0.2.tar.gz deleted file mode 100644 index 038a0a2010..0000000000 Binary files a/vendor/vcrpy-1.0.2.tar.gz and /dev/null differ diff --git a/vendor/vcrpy-1.1.3.tar.gz b/vendor/vcrpy-1.1.3.tar.gz new file mode 100644 index 0000000000..d502493273 Binary files /dev/null and b/vendor/vcrpy-1.1.3.tar.gz differ diff --git a/vendor/wrapt-1.10.2.tar.gz b/vendor/wrapt-1.10.2.tar.gz new file mode 100644 index 0000000000..c63b59f419 Binary files /dev/null and b/vendor/wrapt-1.10.2.tar.gz differ