summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/sleektest.py2
-rw-r--r--tests/test_iqstanzas.py5
2 files changed, 2 insertions, 5 deletions
diff --git a/tests/sleektest.py b/tests/sleektest.py
index a7116544..0adab2b2 100644
--- a/tests/sleektest.py
+++ b/tests/sleektest.py
@@ -258,7 +258,7 @@ class SleekTest(unittest.TestCase):
self.checkPresence(data, sent, use_values)
def streamClose(self):
- if self.xmpp is not None:
+ if hasattr(self, 'xmpp') and self.xmpp is not None:
self.xmpp.disconnect()
self.xmpp.socket.recvData(self.xmpp.stream_footer)
diff --git a/tests/test_iqstanzas.py b/tests/test_iqstanzas.py
index 98a01a26..2dabc5e9 100644
--- a/tests/test_iqstanzas.py
+++ b/tests/test_iqstanzas.py
@@ -4,10 +4,6 @@ from sleekxmpp.xmlstream.stanzabase import ET
class TestIqStanzas(SleekTest):
- def setUp(self):
- """Start XML stream for testing."""
- self.streamStart()
-
def tearDown(self):
"""Shutdown the XML stream after testing."""
self.streamClose()
@@ -32,6 +28,7 @@ class TestIqStanzas(SleekTest):
def testUnhandled(self):
"""Test behavior for Iq.unhandled."""
+ self.streamStart()
self.streamRecv("""
<iq id="test" type="get">
<query xmlns="test" />