mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-18 03:11:46 -05:00
Use pycodestyle instead of PEP8
PEP8 was renamed to pycodestyle; this issue explains why: https://github.com/PyCQA/pycodestyle/issues/466 This commit changes our tests to use pycodestyle instead of pep8. It also means: - making a couple of whitespace changes to appease the linter - disabling warnings for bare `Except`s (ie `Except` instead of `Except ValueError`) – this seems like a sensible thing to catch but I’m not going to make meaningful code changes in this commit
This commit is contained in:
@@ -96,7 +96,7 @@ Then simply run
|
|||||||
make test
|
make test
|
||||||
```
|
```
|
||||||
|
|
||||||
That will run pep8 for code analysis and our unit test suite. If you wish to run our functional tests, instructions can be found in the
|
That will run pycodestyle for code analysis and our unit test suite. If you wish to run our functional tests, instructions can be found in the
|
||||||
[notifications-functional-tests](https://github.com/alphagov/notifications-functional-tests) repository.
|
[notifications-functional-tests](https://github.com/alphagov/notifications-functional-tests) repository.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ class Service(db.Model, Versioned):
|
|||||||
default=BRANDING_GOVUK
|
default=BRANDING_GOVUK
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
MOBILE_TYPE = 'mobile'
|
MOBILE_TYPE = 'mobile'
|
||||||
EMAIL_TYPE = 'email'
|
EMAIL_TYPE = 'email'
|
||||||
|
|
||||||
@@ -340,6 +341,7 @@ class TemplateHistory(db.Model):
|
|||||||
nullable=False,
|
nullable=False,
|
||||||
default=NORMAL)
|
default=NORMAL)
|
||||||
|
|
||||||
|
|
||||||
MMG_PROVIDER = "mmg"
|
MMG_PROVIDER = "mmg"
|
||||||
FIRETEXT_PROVIDER = "firetext"
|
FIRETEXT_PROVIDER = "firetext"
|
||||||
SES_PROVIDER = 'ses'
|
SES_PROVIDER = 'ses'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-r requirements.txt
|
-r requirements.txt
|
||||||
pep8==1.7.0
|
pycodestyle==2.3.1
|
||||||
pytest==3.0.1
|
pytest==3.0.1
|
||||||
pytest-mock==1.2
|
pytest-mock==1.2
|
||||||
pytest-cov==2.3.1
|
pytest-cov==2.3.1
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function display_result {
|
|||||||
if [[ -z "$VIRTUAL_ENV" ]] && [[ -d venv ]]; then
|
if [[ -z "$VIRTUAL_ENV" ]] && [[ -d venv ]]; then
|
||||||
source ./venv/bin/activate
|
source ./venv/bin/activate
|
||||||
fi
|
fi
|
||||||
pep8 .
|
pycodestyle .
|
||||||
display_result $? 1 "Code style check"
|
display_result $? 1 "Code style check"
|
||||||
|
|
||||||
py.test --cov=app --cov-report=term-missing tests/ --junitxml=test_results.xml
|
py.test --cov=app --cov-report=term-missing tests/ --junitxml=test_results.xml
|
||||||
|
|||||||
Reference in New Issue
Block a user