Commit Graph

9 Commits

Author SHA1 Message Date
Carlo Costino
7163f813ce Fix malformed tuples
Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2023-10-12 10:26:01 -04:00
Carlo Costino
35ecd7006a Finally finished linting all the tests!
...Now to fix the ones I broke... :lolsob:

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2023-10-12 10:26:01 -04:00
Kenneth Kehl
8c9721d8e2 notify-api-412 use black to enforce python coding style 2023-08-25 09:12:23 -07:00
Ben Thorner
5bfce61bcf Rename "app_" fixture to "notify_admin"
This naming was introduced in 2016 without explanation [1]. I find it
confusing because:

- It's reminiscent of "_app", which is a Python convention indicating
the variable is internal, so maybe avoid using it.

- It suggests there's some other "app" fixture I should be using (there
isn't, though).

The Python style guide describes using an underscore suffix to avoid
clashes with inbuilt names [1], which is sort of applicable if we need
to import the "app" module [2]. However, we can also avoid clashes by
choosing a different name, without the strange underscore.

[1]: 3b1d521c10
[2]: 78824f54fd/tests/app/main/views/test_forgot_password.py (L5)
2021-05-19 11:44:20 +01:00
Leo Hemsted
be038e345d define isort first party (app and tests)
we were seeing isort produce different outputs locally and in docker -
this was due to it having different opinions about whether the tests
module (ie all our unit tests) is a first party (local) or third party
(pip installed) import. It's a first party import, so by defining this
in the setup.cfg isort settings, we can force it to be consistent
between environments.

Note: I don't know why it was different in the first place though
2018-04-25 14:12:58 +01:00
Chris Hill-Scott
f3a0c505bd Enforce order and style of imports
Done using isort[1], with the following command:
```
isort -rc ./app ./tests
```

Adds linting to the `run_tests.sh` script to stop badly-sorted imports
getting re-introduced.

Chosen style is ‘Vertical Hanging Indent’ with trailing commas, because
I think it gives the cleanest diffs, eg:
```
from third_party import (
    lib1,
    lib2,
    lib3,
    lib4,
)
```

1. https://pypi.python.org/pypi/isort
2018-02-27 16:35:13 +00:00
Athanasios Voutsadakis
bde734dc75 Use test_client() as context manager 2017-11-16 17:02:38 +00:00
Athanasios Voutsadakis
8786ce79f4 Use parametrize 2017-11-16 16:34:10 +00:00
Athanasios Voutsadakis
0d2adfcce2 Add basic tests 2017-11-14 15:26:03 +00:00