Skip to content

Instantly share code, notes, and snippets.

@elyezer
Last active November 11, 2015 16:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elyezer/51249569d129defe62f4 to your computer and use it in GitHub Desktop.
Save elyezer/51249569d129defe62f4 to your computer and use it in GitHub Desktop.
import pytest
import unittest
from nose.plugins.attrib import attr
class MyTestCase(unittest.TestCase):
@pytest.mark.crud
def test_pytest_crud(self):
pass
@attr('crud')
def test_nosetests_crud(self):
pass
$ nosetests pytest_nosetest.py
..
----------------------------------------------------------------------
Ran 2 tests in 0.001s
OK
$ py.test pytest_nosetest.py
======================= test session starts =======================
platform linux -- Python 3.4.2, pytest-2.8.2, py-1.4.30, pluggy-0.3.1
rootdir: /home/elyezer/code/robottelo, inifile:
plugins: cov-2.2.0
collected 2 items
pytest_nosetest.py ..
==================== 2 passed in 0.03 seconds =====================
(robottelo) ~/code/robottelo   fix-2414  python -m unittest pytest_nosetest
..
----------------------------------------------------------------------
Ran 2 tests in 0.000s
OK
$ python -m unittest pytest_nosetest
..
----------------------------------------------------------------------
Ran 2 tests in 0.000s
OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment