Commit Graph
128 Commits
Author SHA1 Message Date
Ryan Ahearn 2597011cee make audit for python dependency audits 2022-08-12 15:36:48 +00:00
Katie Smith c50eae11c3 Upgrade all test requirements 2022-05-17 10:33:49 +01:00
Katie Smith c3829da864 Bump all test dependencies 2022-04-14 09:07:39 +01:00
Katie Smith 7fabc9d0c5 Bump test dependencies 2022-03-09 16:21:58 +00:00
Katie Smith a8ed76d4a7 Bump all test dependencies which require no code changes 2022-03-02 17:18:32 +00:00
Katie Smith 514bd48614 Update flake8-bugbear from 20.11.1 to 22.1.11
And ignore a warning, since I did not think that in this case "Using
.strip() with multi-character strings is misleading the reader".
2022-03-02 16:51:09 +00:00
Katie Smith 807db037eb Update flake8 from 3.8.4 to 4.0.1
And adds `noqa` to some non-errors which are being flagged.
2022-03-02 15:52:18 +00:00
Pea Tyczynska c28e9451d4 Bump moto version to try solve dependencies version conflict
Also update mock import statements in some test files as they
stopped working with this dependency update.
2021-07-08 15:37:19 +01:00
David McDonald 04e23ca6a9 Revert "Bump utils version for new invalid address character" 2021-06-01 10:53:28 +01:00
Rebecca Law 50de85988e Fix dependency issues
We haven't bumped the test version for a while.
Also bumped the version of Flask and itsdangerous.
In order to fix flask warnings I needed to changed how the blueprints were registerd.
2021-05-27 13:02:24 +01:00
Rebecca Law f66f0a2e2d Bump moto dependency to resolve dependency conflicts 2021-05-25 14:20:25 +01:00
Ben Thorner 8954cec5a1 Add tests for celery task superclass
This requires upgrading freezegun, as time.monotonic wasn't frozen
by v1.0. Note that we need to explicitly specify the base class for
the task in the test, the reason for which is quite subtle:

- Normally, by using the 'notify_api' fixture, the base class is set
to NotifyTask automatically by running app.create_app [1].

- However, when run alongside other tests, the imports of files with
other celery tasks cause the base class to be instantiated and cached
as the default Celery one. This means none of our tests actually use
our custom superclass when testing tasks.

Because we can't run 'apply_async' directly (since this would require
an actual Celery broker), we need to manually push/pop the request
Context that's normally done as part of sending a task.

Note also that we use a UUID as the name for a task, since these are
global. We want to avoid the task polluting other tests in future,
as well as make it clear the task is being reused.

[1]: https://github.com/alphagov/notifications-api/blob/dea5828d0e708bc69916a98e2bff989a56112204/app/__init__.py#L113
2021-04-12 14:50:02 +01:00
Ben Thorner 321b4913ed Enforce consistency in imports as part of build
This copies the config we use in the admin app, with a few changes
as discussed in the PR [1]. We'll apply these to our other apps.

[1]: https://github.com/alphagov/notifications-api/pull/3175#issuecomment-795530323
2021-03-12 11:45:21 +00:00
Chris Hill-Scott 3b0b96834d Do extra code style checks with flake8-bugbear
Flake8 Bugbear checks for some extra things that aren’t code style
errors, but are likely to introduce bugs or unexpected behaviour. A
good example is having mutable default function arguments, which get
shared between every call to the function and therefore mutating a value
in one place can unexpectedly cause it to change in another.

This commit enables all the extra warnings provided by Flake8 Bugbear,
except for:
- the line length one (because we already lint for that separately)
- B903 Data class should either be immutable or use `__slots__` because
  this seems to false-positive on some of our custom exceptions
- B902 Invalid first argument 'cls' used for instance method because
  some SQLAlchemy decorators (eg `declared_attr`) make things that
  aren’t formally class methods take a class not an instance as their
  first argument

It disables:
- _B306: BaseException.message is removed in Python 3_ because I think
  our exceptions have a custom structure that means the `.message`
  attribute is still present

Matches the work done in other repos:
- https://github.com/alphagov/notifications-admin/pull/3172/files
2020-12-22 16:26:45 +00:00
Leo Hemsted 45cc74bcc0 bump test requirements 2020-12-07 14:51:05 +00:00
Leo Hemsted 61a5730596 add more friendly datetime validator to jsonschema
add `datetime` format (note, not the built-in `date-time`) to our json
schemas. this uses the iso8601 library to try and parse the string.

also, move `strict-rfc3339` and `rfc3987` (used by jsonschema to
validate `date-time` and `uri` formats respectively from test
requirements to regular requirements. if they're not installed,
validation silently succeeds, so validation wouldnt reject anything bad
on prod, only in unit tests.
2020-07-09 14:19:58 +01:00
Leo Hemsted c3b1766220 bump test requirements 2020-01-06 16:07:06 +00:00
David McDonald 542f3b23aa Remove coveralls
We don't use it anymore
2019-12-24 08:37:19 +00:00
Leo Hemsted 5e9a21f5d0 bump requirements 2019-11-18 15:48:38 +00:00
Katie Smith e504410ced 🎉 Pytest 5 🎉 2019-10-31 15:50:37 +00:00
Katie Smith 1d6716275a Bump utils to bring in changes to logging
Freezing the requirements changes the Werkzeug version to 0.16.0, which
requires a change in how we import an exception
(https://github.com/pallets/werkzeug/blob/master/CHANGES.rst#version-0160)
2019-10-28 10:54:19 +00:00
Katie Smith 6de67411df Merge pull request #2485 from alphagov/pin-pytest-xdist
Make pyup ignore pytest-xdist
2019-04-29 14:30:55 +01:00
Katie Smith f34c183806 Merge pull request #2478 from alphagov/pyup-update-moto-1.3.7-to-1.3.8
Update moto to 1.3.8
2019-04-29 14:18:59 +01:00
Katie Smith 8c33fadd4d Make pyup ignore pytest-xdist
The next available version of pytest-xdist is 1.28.0, which requires
pytest>=4.4. We currently have Pytest pinned to version 3.

https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst#pytest-xdist-1280-2019-04-02
2019-04-29 14:15:43 +01:00
pyup-bot 64f1e528c8 Update pytest-mock from 1.10.2 to 1.10.4 2019-04-24 16:06:13 +01:00
pyup-bot c13118a8e4 Update moto from 1.3.7 to 1.3.8 2019-04-24 16:06:09 +01:00
Leo Hemsted 3277c65a7c add jinja2-cli to dev requirements 2019-04-11 15:05:44 +01:00
Chris Hill-Scott 6c20e510e8 Merge pull request #2416 from alphagov/pyup-update-pytest-mock-1.10.1-to-1.10.2
Update pytest-mock to 1.10.2
2019-03-26 09:37:37 +00:00
pyup-bot 528275546a Update pytest-mock from 1.10.1 to 1.10.2 2019-03-25 12:28:14 +00:00
Chris Hill-Scott 0927a2e731 Merge branch 'master' into pyup-update-coveralls-1.6.0-to-1.7.0 2019-03-25 11:27:36 +00:00
pyup-bot 365abd9a98 Update pytest-xdist from 1.26.1 to 1.27.0 2019-03-21 13:26:54 +00:00
pyup-bot 99781c1a19 Update coveralls from 1.6.0 to 1.7.0 2019-03-20 03:25:08 +00:00
pyup-bot aad78cedf7 Update flake8 from 3.7.6 to 3.7.7 2019-02-25 17:10:59 +00:00
Leo Hemsted 335eeea235 bump requirements
pyup ignore pytest until we sort all the fixtures as functions issues
2019-02-19 16:17:33 +00:00
Leo Hemsted 27fc67bdae reqs bump 2019-02-06 16:49:56 +00:00
pyup-bot 862cdb6151 Update flake8 from 3.7.3 to 3.7.4 2019-02-01 05:41:24 +00:00
pyup-bot a4bb47d55e Update flake8 from 3.6.0 to 3.7.3 2019-01-31 05:41:30 +00:00
Pea (Malgorzata Tyczynska) 7d35f5d6a6 Merge branch 'master' into pyup-update-pytest-xdist-1.24.1-to-1.26.0 2019-01-25 16:39:04 +00:00
pyup-bot 1d955e5f2d Update pytest-xdist from 1.24.1 to 1.26.0 2019-01-11 21:23:48 +00:00
pyup-bot b068a850fa Update pytest-cov from 2.6.0 to 2.6.1 2019-01-07 02:12:39 +00:00
Katie Smith 5ad549ba2f Merge pull request #2235 from alphagov/bump-utils-to-3.7.0
Bump notifications-utils to 3.7.0
2018-11-26 14:25:48 +00:00
Katie Smith ff06d120e8 Bump notifications-utils to 3.7.0
Bumped notifications-utils to 3.7.0. Version 3.7.0 includes the
`convert_utc_to_bst` and `convert_bst_to_utc` functions and the
`LETTER_PROCESSING_DEADLINE` constant, so these have been removed from
this repo and anywhere using these has now been updated to get these
from `notifications-utils`.

Also bumped pytest by a patch version to bring in a bug fix.
2018-11-26 12:53:39 +00:00
pyup-bot 2a74a6fb72 Update pytest-xdist from 1.24.0 to 1.24.1 2018-11-10 14:07:42 +00:00
Leo Hemsted 267c4fc07b bump requirements, fix pyflake8 things, unpin botocore/awscli 2018-11-07 13:39:08 +00:00
pyup-bot dd6f4fb64d Update pytest from 3.9.2 to 3.9.3 2018-10-27 19:12:13 +01:00
pyup-bot a21b49a7f7 Update pytest from 3.9.1 to 3.9.2 2018-10-23 03:56:05 +01:00
Leo Hemsted 29ea2e51d6 bump requirements
also pyup ignore awscli and botocore because that complex mesh of
dependency hell doesn't play will with pyup opening a new PR every time
that botocore/awscli update (every few days)
2018-10-22 14:43:08 +01:00
Katie Smith 3926453b1e Merge pull request #2079 from alphagov/pyup-update-pytest-cov-2.5.1-to-2.6.0
Update pytest-cov to 2.6.0
2018-09-12 11:24:19 +01:00
pyup-bot f8229806b1 Update pytest from 3.7.4 to 3.8.0 2018-09-06 14:48:33 +01:00
Chris Hill-Scott f1aa02f40c Merge branch 'master' into pyup-update-pytest-3.7.3-to-3.7.4 2018-09-04 10:22:12 +01:00