a collection of helpers for the unittest module
Project description
younit is a collection of helpers for the unittest module.
Helpers
I want to |
Helpers to Use |
---|---|
Test coroutines |
@asyncio_test |
Mock out coroutines |
AsyncMock(), @asyncio_test |
Print the name of a test before running it |
@test_name |
Fail a test if it hangs |
@set_test_hang_alarm, @clear_test_hang_alarm, or @test_hang_alarm |
Close all threads associated with a test |
@close_all_threads |
Get It Now
$ pip install younit
Examples
Testing and mocking coroutines:
class MyTestCase(unittest.TestCase):
async def async_setUp(self):
pass
async def async_tearDown(self):
pass
@asyncio_test
async def test_this(self):
x = AsyncMock()
await x()
x.mock.assert_called_once()
Setting up test hang alarms:
class MyTestCase(unittest.TestCase):
@set_test_hang_alarm
def setUp(self):
pass
@clear_test_hang_alarm
def tearDown(self):
pass
More at https://younit.readthedocs.io
Project Links
License
MIT licensed. See the bundled LICENSE file for more details. ~
Changelog
0.1.0 (2017-07-21)
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file younit-0.1.0.tar.gz
.
File metadata
- Download URL: younit-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c5cae8add531fe6480efc0528a673ed7da7558267f60a13b4f625f778748e8e |
|
MD5 | 62f3419bdd25a734bc617887694579f2 |
|
BLAKE2b-256 | 4ad4aa2d57ac1277c6446d11b04bb612b680cb5a11086dbd8e25c890128fe692 |
File details
Details for the file younit-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: younit-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1875cebc212f34d09ee4fad93b576702ffab343a88be1e6a707450d64daf819b |
|
MD5 | 609085845843e0ff35b15c5e99f40e3e |
|
BLAKE2b-256 | e7ad4273d1381b9a8fdb7f76a2f562018ed1bbf0b28f6b5a9f26942d14b95b2f |