Skip to content

Commit

Permalink
Merge pull request #364 from eduzen/#359-pytest-I
Browse files Browse the repository at this point in the history
pytest I: replaced test runner: pytest instead of nosetest.
  • Loading branch information
facundobatista authored May 21, 2019
2 parents a9271e0 + fbcfce0 commit 577b4be
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ install:

# Check that we have the expected version and architecture for Python
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""

build: off

test_script:
# Run the project tests
- "%CMD_IN_ENV% python bin/fades -v -r requirements.txt -x nosetests -v -s tests"
- "%CMD_IN_ENV% python bin/fades -v -r requirements.txt -x pytest"
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
language: python

python:
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "3.7-dev"
install:
- "pip install -r requirements.txt"
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then pip install python-coveralls ; fi
script:
- "nosetests --with-xcoverage --cover-package=fades -v fades tests"
- "pytest --cov=fades"
after_script:
- "flake8 fades --max-line-length=99 --select=E,W,F,C,N"

Expand Down
8 changes: 6 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
flake8==3.5.0
logassert==2
mccabe==0.6.1
nose==1.3.7
nosexcover==1.0.10
pep257==0.7.0
pep8==1.7.0
pycodestyle==2.3.1
Expand All @@ -12,3 +10,9 @@ pyxdg==0.25
rst2html5==1.9.3
setuptools>=5.5
wheel==0.26.0
coverage==4.0.3
pytest==4.4.2
pytest-xdist==1.28.0
pytest-sugar==0.9.2
pytest-cov==2.5.1
pytest-mock==1.10.4
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def finalize_options(self):
'install': CustomInstall,
},
install_requires=['setuptools'],
tests_require=['logassert', 'pyxdg', 'pyuca', 'nose', 'flake8',
tests_require=['logassert', 'pyxdg', 'pyuca', 'pytest', 'flake8',
'pep257', 'rst2html5'], # what unittests require
python_requires='>=3.3', # Minimum Python version supported.
extras_require={
Expand Down
4 changes: 2 additions & 2 deletions test
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ set -eu
if [ $# -ne 0 ]; then
TARGET_TESTS="$@"
else
TARGET_TESTS="fades tests"
TARGET_TESTS=""
fi

FADES='./bin/fades -r requirements.txt'

$FADES -x nosetests --with-xcoverage --cover-package=fades -v -s $TARGET_TESTS
$FADES -x pytest --cov=fades $TARGET_TESTS

# check if we are using exit() in the code.
if grep -r -n ' exit(' --include="*.py" .; then echo 'Please use sys.exit() instead of exit(). https://github.com/PyAr/fades/issues/280'; fi
4 changes: 2 additions & 2 deletions testdev
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -eu
if [ $# -ne 0 ]; then
TARGET_TESTS="$@"
else
TARGET_TESTS="fades tests"
TARGET_TESTS=""
fi

./bin/fades -r requirements.txt -x nosetests -v -s $TARGET_TESTS
./bin/fades -r requirements.txt -x pytest $TARGET_TESTS
2 changes: 1 addition & 1 deletion testdev.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ if not [%*] == [] (
set TARGET_TESTS=fades tests
)

bin\fades -r requirements.txt -x nosetests -v -s %TARGET_TESTS%
bin\fades -r requirements.txt -x pytest -v %TARGET_TESTS%

0 comments on commit 577b4be

Please sign in to comment.