Skip to content

Commit 3a91c14

Browse files
pgajdosnateprewitt
authored andcommitted
use pytest instead of nose
1 parent ce48812 commit 3a91c14

File tree

5 files changed

+16
-17
lines changed

5 files changed

+16
-17
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ tests/.coverage
1313
.tox
1414
.coverage
1515
coverage.xml
16-
nosetests.xml
1716

1817
# Common virtualenv names
1918
venv

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ Running Tests
8484
~~~~~~~~~~~~~
8585
You can run tests in all supported Python versions using ``tox``. By default,
8686
it will run all of the unit and functional tests, but you can also specify your own
87-
``nosetests`` options. Note that this requires that you have all supported
87+
``pytest`` options. Note that this requires that you have all supported
8888
versions of Python installed, otherwise you must pass ``-e`` or run the
89-
``nosetests`` command directly:
89+
``pytest`` command directly:
9090

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

9999
.. code-block:: sh
100100
101-
$ nosetests tests/unit
101+
$ pytest tests/unit
102102
103103
104104
Getting Help

tests/functional/docs/test_smoke.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13-
from nose.tools import assert_true
13+
import pytest
1414
import botocore.session
1515
from botocore import xform_name
1616
from botocore.exceptions import DataNotFoundError
@@ -62,7 +62,7 @@ def test_docs_generated():
6262

6363
def _assert_contains_lines_in_order(lines, contents):
6464
for line in lines:
65-
assert_true(line in contents)
65+
assert line in contents
6666
beginning = contents.find(line)
6767
contents = contents[(beginning + len(line)):]
6868

tests/functional/test_smoke.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13-
from nose.tools import assert_true
13+
import pytest
1414

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

3939

4040
def test_can_create_all_clients():
@@ -45,7 +45,7 @@ def test_can_create_all_clients():
4545

4646
def _test_create_client(session, service_name):
4747
client = session.client(service_name)
48-
assert_true(hasattr(client, 'meta'))
48+
assert hasattr(client, 'meta')
4949

5050

5151
def test_api_versions_synced_with_botocore():

tests/unit/resources/test_collection_smoke.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# language governing permissions and limitations under the License.
1313
import botocore.session
1414
from botocore import xform_name
15-
from nose.tools import assert_false
15+
import pytest
1616

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

0 commit comments

Comments
 (0)