Skip to main content

Extra testing goodies for nose.tools

Project description

About

Extra testing goodies for nose.tools.

Adds an issues_warnings decorator, where tests must issue one of the expected warnings to pass (similar to nose.tools.raises for exceptions).

If installed on Python < 2.7 backports the new unittest.TestCase.assert* methods, and converts them to nose style assertions (spelled in PEP 8 fashion, so assert_equal rather than assertEqual):

  • assert_greater / assert_less / assert_greater_equal / assert_less_equal

  • assert_regexp_matches / assert_not_regexp_matches

  • assert_in / assert_not_in

  • assert_is / assert_is_not

  • assert_is_none / assert_is_not_none

  • assert_dict_contains_subset

  • and more….

Installation

To install nose_extra_tools run:

$ pip install nose_extra_tools

Usage examples

from nose_extra_tools import assert_in, issues_warnings

@issues_warnings(UserWarning, DeprecationWarning)
def test_issues_deprecation_warning():
    import warnings
    warnings.warn('This test passes')

@issues_warnings(Warning)
def test_forgot_to_issue_warning():
    pass

def test_backported_assert_in():
    assert_in(10, range(5))

Contribute

If you find any bugs, or wish to propose new features please let me know.

If you’d like to contribute, simply fork the repository, commit your changes and send a pull request. Make sure you add yourself to AUTHORS.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nose_extra_tools-1.0.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

nose_extra_tools-1.0.2-py2-none-any.whl (4.4 kB view details)

Uploaded Python 2

File details

Details for the file nose_extra_tools-1.0.2.tar.gz.

File metadata

  • Download URL: nose_extra_tools-1.0.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for nose_extra_tools-1.0.2.tar.gz
Algorithm Hash digest
SHA256 a477caab60a8a636843ab7e3809df7cb1db6b32bb4c973fec756e82839e52ae8
MD5 e5bb960d2a172e1c84295775f1bd6c05
BLAKE2b-256 87e2cb82b991f09beeab5de447e3c5f5fc498fabb05a8d606e2bf775ffa542b3

See more details on using hashes here.

File details

Details for the file nose_extra_tools-1.0.2-py2-none-any.whl.

File metadata

File hashes

Hashes for nose_extra_tools-1.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 7418e3a060c4132dcac25836ca75746a338b6c6b6e9245890751ba75e16a4414
MD5 947d9cf4e35798d844e7d5de9f5c85db
BLAKE2b-256 608fdd6b6b2dc99f250232fb869fcd3bd9ee5ad2d158ed53606948adc053ef5d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page