Switching from the no-longer-maintained nose test runner to pytest.

This commit is contained in:
Dan Helfman 2016-04-10 15:59:36 -07:00
parent 5b66dc69a1
commit 0ea5824427
6 changed files with 11 additions and 14 deletions

View file

@ -2,7 +2,7 @@ import os
import sys import sys
from flexmock import flexmock from flexmock import flexmock
from nose.tools import assert_raises import pytest
from atticmatic import command as module from atticmatic import command as module
@ -66,7 +66,7 @@ def test_parse_arguments_with_invalid_arguments_exits():
sys.stderr = sys.stdout sys.stderr = sys.stdout
try: try:
with assert_raises(SystemExit): with pytest.raises(SystemExit):
module.parse_arguments(COMMAND_NAME, '--posix-me-harder') module.parse_arguments(COMMAND_NAME, '--posix-me-harder')
finally: finally:
sys.stderr = original_stderr sys.stderr = original_stderr

View file

@ -1,7 +1,7 @@
from collections import OrderedDict from collections import OrderedDict
from flexmock import flexmock from flexmock import flexmock
from nose.tools import assert_raises import pytest
from atticmatic import config as module from atticmatic import config as module
@ -61,7 +61,7 @@ def test_validate_configuration_format_with_missing_required_section_should_rais
), ),
) )
with assert_raises(ValueError): with pytest.raises(ValueError):
module.validate_configuration_format(parser, config_format) module.validate_configuration_format(parser, config_format)
@ -96,7 +96,7 @@ def test_validate_configuration_format_with_unknown_section_should_raise():
module.Section_format('section', options=()), module.Section_format('section', options=()),
) )
with assert_raises(ValueError): with pytest.raises(ValueError):
module.validate_configuration_format(parser, config_format) module.validate_configuration_format(parser, config_format)
@ -114,7 +114,7 @@ def test_validate_configuration_format_with_missing_required_option_should_raise
), ),
) )
with assert_raises(ValueError): with pytest.raises(ValueError):
module.validate_configuration_format(parser, config_format) module.validate_configuration_format(parser, config_format)
@ -146,7 +146,7 @@ def test_validate_configuration_format_with_extra_option_should_raise():
), ),
) )
with assert_raises(ValueError): with pytest.raises(ValueError):
module.validate_configuration_format(parser, config_format) module.validate_configuration_format(parser, config_format)
@ -228,5 +228,5 @@ def test_parse_configuration_with_file_open_error_should_raise():
parser = insert_mock_parser() parser = insert_mock_parser()
parser.should_receive('read').and_return([]) parser.should_receive('read').and_return([])
with assert_raises(ValueError): with pytest.raises(ValueError):
module.parse_configuration('filename', config_format=flexmock()) module.parse_configuration('filename', config_format=flexmock())

View file

@ -1,5 +1,2 @@
[metadata] [metadata]
description-file=README.md description-file=README.md
[nosetests]
detailed-errors=1

View file

@ -30,6 +30,6 @@ setup(
}, },
tests_require=( tests_require=(
'flexmock', 'flexmock',
'nose', 'pytest',
) )
) )

View file

@ -1,2 +1,2 @@
flexmock==0.10.2 flexmock==0.10.2
nose==1.3.4 pytest==2.9.1

View file

@ -5,4 +5,4 @@ skipsdist=True
[testenv] [testenv]
usedevelop=True usedevelop=True
deps=-rtest_requirements.txt deps=-rtest_requirements.txt
commands = nosetests [] commands = py.test []