Skip to content

Commit

Permalink
use pytest instead of nose
Browse files Browse the repository at this point in the history
  • Loading branch information
pgajdos authored and nateprewitt committed Sep 23, 2021
1 parent ce48812 commit 3a91c14
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ tests/.coverage
.tox
.coverage
coverage.xml
nosetests.xml

# Common virtualenv names
venv
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ Running Tests
~~~~~~~~~~~~~
You can run tests in all supported Python versions using ``tox``. By default,
it will run all of the unit and functional tests, but you can also specify your own
``nosetests`` options. Note that this requires that you have all supported
``pytest`` options. Note that this requires that you have all supported
versions of Python installed, otherwise you must pass ``-e`` or run the
``nosetests`` command directly:
``pytest`` command directly:

.. code-block:: sh
Expand All @@ -98,7 +98,7 @@ You can also run individual tests with your default Python version:

.. code-block:: sh
$ nosetests tests/unit
$ pytest tests/unit
Getting Help
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/docs/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from nose.tools import assert_true
import pytest
import botocore.session
from botocore import xform_name
from botocore.exceptions import DataNotFoundError
Expand Down Expand Up @@ -62,7 +62,7 @@ def test_docs_generated():

def _assert_contains_lines_in_order(lines, contents):
for line in lines:
assert_true(line in contents)
assert line in contents
beginning = contents.find(line)
contents = contents[(beginning + len(line)):]

Expand Down
6 changes: 3 additions & 3 deletions tests/functional/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from nose.tools import assert_true
import pytest

from boto3.session import Session
import botocore.session
Expand All @@ -34,7 +34,7 @@ def _test_create_resource(session, service_name):
resource = session.resource(service_name)
# Verifying we have a "meta" attr is just an arbitrary
# sanity check.
assert_true(hasattr(resource, 'meta'))
assert hasattr(resource, 'meta')


def test_can_create_all_clients():
Expand All @@ -45,7 +45,7 @@ def test_can_create_all_clients():

def _test_create_client(session, service_name):
client = session.client(service_name)
assert_true(hasattr(client, 'meta'))
assert hasattr(client, 'meta')


def test_api_versions_synced_with_botocore():
Expand Down
16 changes: 8 additions & 8 deletions tests/unit/resources/test_collection_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# language governing permissions and limitations under the License.
import botocore.session
from botocore import xform_name
from nose.tools import assert_false
import pytest

from boto3.session import Session
from boto3.resources.model import ResourceModel
Expand Down Expand Up @@ -108,10 +108,10 @@ def _assert_collection_has_paginator_if_needed(
# Make sure that if the operation looks paginated then there is
# a paginator for the client to use for the collection.
if not can_paginate_operation:
assert_false(
looks_paginated,
'Collection %s on resource %s of service %s uses the operation '
'%s, but the operation has no paginator even though it looks '
'paginated.' % (
collection_model.name, resource_name, service_name,
underlying_operation_name))
assert not\
looks_paginated,\
'Collection %s on resource %s of service %s uses the operation '\
'%s, but the operation has no paginator even though it looks '\
'paginated.' % (\
collection_model.name, resource_name, service_name,\
underlying_operation_name)

0 comments on commit 3a91c14

Please sign in to comment.