diff --git a/run_tests.sh b/run_tests.sh index 19f1d59d..42d2aca4 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -ex -REPORT_PATH="${REPORT_PATH:-./}" -nosetests --with-xunit --with-coverage --cover-xml --cover-xml-file $REPORT_PATH/coverage.xml --xunit-file=$REPORT_PATH/nosetests.xml --cover-package=talon . +REPORT_PATH="${REPORT_PATH:-.}" +pytest --cov=talon --cov-report=term --cov-report="xml:$REPORT_PATH/coverage.xml" --junitxml="$REPORT_PATH/nosetests.xml" . diff --git a/setup.py b/setup.py index cf8e7e6e..fa1a692d 100755 --- a/setup.py +++ b/setup.py @@ -57,8 +57,7 @@ def finalize_options(self): "joblib", ], tests_require=[ - "mock", - "nose", - "coverage" + "pytest", + "pytest-cov" ] ) diff --git a/test-requirements.txt b/test-requirements.txt index 5f50e2a9..9955decc 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,3 +1,2 @@ -coverage -mock -nose>=1.2.1 +pytest +pytest-cov diff --git a/tests/__init__.py b/tests/__init__.py index 8fdebd6b..a39ca71a 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,5 @@ from __future__ import absolute_import -from nose.tools import * -from mock import * +from unittest.mock import * import talon diff --git a/tests/html_quotations_test.py b/tests/html_quotations_test.py index 85871e73..fa375d32 100644 --- a/tests/html_quotations_test.py +++ b/tests/html_quotations_test.py @@ -6,8 +6,6 @@ import re from unittest.mock import Mock, patch -from nose.tools import assert_false, assert_true, eq_, ok_ - from tests.fixtures import (OLK_SRC_BODY_SECTION, REPLY_QUOTATIONS_SHARE_BLOCK, REPLY_SEPARATED_BY_HR) @@ -31,8 +29,8 @@ def test_quotation_splitter_inside_blockquote(): """ - eq_("
Reply", - RE_WHITESPACE.sub('', quotations.extract_from_html(msg_body))) + assert "Reply" == \ + RE_WHITESPACE.sub('', quotations.extract_from_html(msg_body)) def test_quotation_splitter_outside_blockquote(): @@ -48,8 +46,8 @@ def test_quotation_splitter_outside_blockquote(): """ - eq_("Reply", - RE_WHITESPACE.sub('', quotations.extract_from_html(msg_body))) + assert "Reply" == \ + RE_WHITESPACE.sub('', quotations.extract_from_html(msg_body)) def test_regular_blockquote(): @@ -66,8 +64,8 @@ def test_regular_blockquote(): """ - eq_("ReplyRegular", - RE_WHITESPACE.sub('', quotations.extract_from_html(msg_body))) + assert "Reply
Regular" == \ + RE_WHITESPACE.sub('', quotations.extract_from_html(msg_body)) def test_no_blockquote(): @@ -94,12 +92,12 @@ def test_no_blockquote(): Reply