Skip to content

Instantly share code, notes, and snippets.

@graingert
Last active Aug 29, 2015
Embed
What would you like to do?
$ nosetests test_stuff.py
E.E
======================================================================
ERROR: test_assert_true (test_stuff.TestFail)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vagrant/test_stuff.py", line 17, in test_assert_true
raise Exception
Exception
======================================================================
ERROR: test_stuff.test_dotup
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/hogarth/envs/redacted/dev/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/vagrant/test_stuff.py", line 7, in test_dotup
raise Exception
Exception
----------------------------------------------------------------------
Ran 3 tests in 0.005s
FAILED (errors=2)
$ nosetests test_stuff.py --attr="flop"
E
======================================================================
ERROR: test_assert_true (test_stuff.TestFail)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vagrant/test_stuff.py", line 17, in test_assert_true
raise Exception
Exception
----------------------------------------------------------------------
Ran 1 test in 0.003s
FAILED (errors=1)
$ nosetests test_stuff.py --attr="!flop"
-bash: !flop: event not found
$ nosetests test_stuff.py --attr="\!flop"
----------------------------------------------------------------------
Ran 0 tests in 0.000s
OK
$ nosetests test_stuff.py --eval-attr="not flop"
E.E
======================================================================
ERROR: test_assert_true (test_stuff.TestFail)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vagrant/test_stuff.py", line 17, in test_assert_true
raise Exception
Exception
======================================================================
ERROR: test_stuff.test_dotup
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/hogarth/envs/zonza/dev/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/vagrant/test_stuff.py", line 7, in test_dotup
raise Exception
Exception
----------------------------------------------------------------------
Ran 3 tests in 0.003s
FAILED (errors=2)
vagrant@vagrant-zonza-webapp-bork:~$ nosetests test_stuff.py --attr='!tup'
E.
======================================================================
ERROR: test_assert_true (test_stuff.TestFail)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vagrant/test_stuff.py", line 17, in test_assert_true
raise Exception
Exception
----------------------------------------------------------------------
Ran 2 tests in 0.005s
FAILED (errors=1)
vagrant@vagrant-zonza-webapp-bork:~$ nosetests test_stuff.py --attr='!flop'
E.E
======================================================================
ERROR: test_assert_true (test_stuff.TestFail)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vagrant/test_stuff.py", line 17, in test_assert_true
raise Exception
Exception
======================================================================
ERROR: test_stuff.test_dotup
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/hogarth/envs/zonza/dev/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/vagrant/test_stuff.py", line 7, in test_dotup
raise Exception
Exception
----------------------------------------------------------------------
Ran 3 tests in 0.005s
FAILED (errors=2)
from nose.plugins.attrib import attr
from unittest import TestCase
@attr("tup")
def test_dotup():
raise Exception
class TestThings(TestCase):
def test_assert_true(self):
assert(True)
@attr("flop")
class TestFail(TestThings):
def test_assert_true(self):
raise Exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment