Skip to content

Commit

Permalink
global: don't use pytest-flake8
Browse files Browse the repository at this point in the history
Remove ``pytest-flake8`` and replace it with just ``flake8`` as the
former is sometimes not finding style violations present in the code.

Signed-off-by: Jacopo Notarstefano <[email protected]>
  • Loading branch information
jacquerie committed Feb 2, 2018
1 parent dc3907e commit 2603ec5
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ install:
- travis_retry pip install -e .[tests]

script:
- py.test inspire_dojson tests
- ./run-tests.sh

after_success:
- coveralls
Expand Down
26 changes: 26 additions & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# INSPIRE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with INSPIRE. If not, see <http://www.gnu.org/licenses/>.
#
# In applying this license, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

set -e

flake8 inspire_dojson tests
py.test tests
6 changes: 4 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@
include = inspire_dojson/*.py

[tool:pytest]
addopts = --cov=inspire_dojson --cov-report=term-missing:skip-covered --flake8
flake8-ignore = *.py E501 FI12 FI14 FI15 FI16 FI17 FI50 FI51 FI53
addopts = --cov=inspire_dojson --cov-report=term-missing:skip-covered

[flake8]
ignore = *.py E501 FI12 FI14 FI15 FI16 FI17 FI50 FI51 FI53
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
'mock~=2.0,>=2.0.0',
'pytest~=3.0,>=3.1.2',
'pytest-cov~=2.0,>=2.5.1',
'pytest-flake8~=0.0,>=0.8.1',
]

extras_require = {
Expand Down
26 changes: 13 additions & 13 deletions tests/test_cds.py
Original file line number Diff line number Diff line change
Expand Up @@ -1194,26 +1194,26 @@ def test_documents_from_8564_s_u_y_8():
) # cds.cern.ch/record/2294664

expected = [
{
't': 'CDS',
'a': 'http://cds.cern.ch/record/2294664/files/James.pdf',
'd': 'Fulltext',
'n': 'James.pdf',
'f': '.pdf',
},
{
't': 'CDS',
'a': 'http://cds.cern.ch/record/2294664/files/James.pdf',
'd': 'Fulltext',
'n': 'James.pdf',
'f': '.pdf',
},
]
result = cds2hep_marc.do(create_record(snippet))

assert expected == result['FFT__']

expected = [
{
'key': 'James.pdf',
'fulltext': True,
'source': 'CDS',
'url': 'http://cds.cern.ch/record/2294664/files/James.pdf',
},
]
'key': 'James.pdf',
'fulltext': True,
'source': 'CDS',
'url': 'http://cds.cern.ch/record/2294664/files/James.pdf',
},
]
result = hep.do(create_record_from_dict(result))

assert validate(result['documents'], subschema) is None
Expand Down
2 changes: 1 addition & 1 deletion tests/test_hep_bd9xx.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ def test_references_from_999C5k():
{
'k': 'Robilotta:2008js',
'z': 0,
},
},
]
result = hep2marc.do(result)

Expand Down

0 comments on commit 2603ec5

Please sign in to comment.