Skip to content

Commit 3716b05

Browse files
authored
Merge pull request #632 from chisholm/fix-test-environment-no-datastore
Fix test_environment_no_datastore() unit tests
2 parents 088d05f + a869cbd commit 3716b05

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

stix2/test/v20/test_environment.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,8 @@ def test_environment_datastore_and_sink():
221221
def test_environment_no_datastore():
222222
env = stix2.Environment(factory=stix2.ObjectFactory())
223223

224-
with pytest.raises(AttributeError) as excinfo:
224+
with pytest.raises(AttributeError):
225225
env.add(stix2.v20.Indicator(**INDICATOR_KWARGS))
226-
assert 'Environment has no data sink to put objects in' in str(excinfo.value)
227226

228227
with pytest.raises(AttributeError) as excinfo:
229228
env.get(INDICATOR_ID)

stix2/test/v21/test_environment.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,8 @@ def test_environment_datastore_and_sink():
230230
def test_environment_no_datastore():
231231
env = stix2.Environment(factory=stix2.ObjectFactory())
232232

233-
with pytest.raises(AttributeError) as excinfo:
233+
with pytest.raises(AttributeError):
234234
env.add(stix2.v21.Indicator(**INDICATOR_KWARGS))
235-
assert 'Environment has no data sink to put objects in' in str(excinfo.value)
236235

237236
with pytest.raises(AttributeError) as excinfo:
238237
env.get(INDICATOR_ID)

0 commit comments

Comments
 (0)