Skip to content

Commit

Permalink
SO SHINY
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Mar 14, 2018
1 parent 4985a51 commit 3128707
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/test_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,25 +539,21 @@ def test_sugar_factory_mutex(self):
"""
Passing both default and factory raises ValueError.
"""
with pytest.raises(ValueError) as ei:
with pytest.raises(ValueError, match="mutually exclusive") as ei:
@attr.s
class C(object):
x = attr.ib(factory=list, default=Factory(list))

assert "mutually exclusive" in ei.value.args[0]

def test_sugar_callable(self):
"""
Factory has to be a callable to prevent people from passing Factory
into it.
"""
with pytest.raises(ValueError) as ei:
with pytest.raises(ValueError, match="must be a callable") as ei:
@attr.s
class C(object):
x = attr.ib(factory=Factory(list))

assert "must be a callable" in ei.value.args[0]


@attr.s
class GC(object):
Expand Down

0 comments on commit 3128707

Please sign in to comment.