Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a misuse of the unittest.expectedFailure decorator. #346

Merged
merged 2 commits into from
Jan 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions traits/tests/test_get_traits.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from traits.testing.unittest_tools import unittest

from ..api import HasTraits, Int, Str, Undefined, ReadOnly, Float
from ..api import Float, HasTraits, Int, ReadOnly, Str, TraitError, Undefined


class Foo(HasTraits):
Expand All @@ -36,12 +36,12 @@ class Bar(HasTraits):

class GetTraitTestCase(unittest.TestCase):

@unittest.expectedFailure
def test_trait_set_bad(self):
b = Foo()
b = Foo(num=23)
# This should fail before and after #234.
b.num = 'first'
self.assertEqual(b.num, 'first')
with self.assertRaises(TraitError):
b.num = 'first'
self.assertEqual(b.num, 23)

def test_trait_set_replaced(self):
b = Foo()
Expand Down