marker for unittest (stdlib)
Project description
Marker library for unittest.
install
pip install testmarker
run tests with marker
Running tests like a python -m unittest discover.
make[1]: Entering directory '$HOME/my/testmarker/examples'
python -m testmarker discover foo --verbose
test_it (foo.tests.test_it.Test0) ... ok
test_it (foo.tests.test_it.Test1) ... ok
test_it (foo.tests.test_it.Test2) ... ok
test_it (foo.tests.test_it.Test3) ... ok
test_it (foo.tests.test_it.Test4) ... ok
test_it (foo.tests.test_it.Test5) ... skipped 'f is default skipped'
test_it (foo.tests.test_it.Test6) ... ok
----------------------------------------------------------------------
Ran 7 tests in 0.000s
OK (skipped=1)
python -m testmarker discover foo --ignore a,b --ignore c --verbose
test_it (foo.tests.test_it.Test0) ... skipped 'a'
test_it (foo.tests.test_it.Test1) ... skipped 'b'
test_it (foo.tests.test_it.Test2) ... skipped 'c'
test_it (foo.tests.test_it.Test3) ... ok
test_it (foo.tests.test_it.Test4) ... ok
test_it (foo.tests.test_it.Test5) ... skipped 'f is default skipped'
test_it (foo.tests.test_it.Test6) ... ok
----------------------------------------------------------------------
Ran 7 tests in 0.000s
OK (skipped=4)
python -m testmarker discover foo --only a,b --verbose
test_it (foo.tests.test_it.Test0) ... ok
test_it (foo.tests.test_it.Test1) ... ok
test_it (foo.tests.test_it.Test2) ... skipped 'c'
test_it (foo.tests.test_it.Test3) ... skipped 'd'
test_it (foo.tests.test_it.Test4) ... skipped 'e'
test_it (foo.tests.test_it.Test5) ... skipped 'f is default skipped'
skipped 'Test6 is skipped by --only option'
----------------------------------------------------------------------
Ran 6 tests in 0.000s
OK (skipped=5)
make[1]: Leaving directory '$HOME/my/testmarker/examples'
marker setting
examples/foo/foo/tests/test_it.py
import unittest
from testmarker import mark
@mark.a
class Test0(unittest.TestCase):
def test_it(self):
pass
@mark.b
class Test1(unittest.TestCase):
def test_it(self):
pass
@mark.c
class Test2(unittest.TestCase):
def test_it(self):
pass
@mark.d
class Test3(unittest.TestCase):
def test_it(self):
pass
@mark.e
class Test4(unittest.TestCase):
def test_it(self):
pass
@mark("f", description="f is default skipped", skip=True)
class Test5(unittest.TestCase):
def test_it(self):
pass
class Test6(unittest.TestCase):
def test_it(self):
pass
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
testmarker-0.1.1.tar.gz
(3.7 kB
view details)
Built Distribution
File details
Details for the file testmarker-0.1.1.tar.gz
.
File metadata
- Download URL: testmarker-0.1.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9d80fc5abd9f113c1f61bd9a979b36b8944e5dcfb267a62bfe40e96163f72b3 |
|
MD5 | dfb3d116b61b8de7d0d0b81052986db4 |
|
BLAKE2b-256 | b14d21d2dfaec8441473bdac66c460a6014be737799dd1ffa2c79d93dd875720 |
Provenance
File details
Details for the file testmarker-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: testmarker-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3a97f62bb95ba0f7ff3188dd77ced65b6f4ae4335a8fb99d955401cee4a8b2c |
|
MD5 | ede7f6b5f78e1b677b91adc254822515 |
|
BLAKE2b-256 | 71fdb583f2f772d13fc10d37ba2c0802fe9514dd8f879c47b806952c3af3d965 |