Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manuels/nose-deadline
Enforced timelimits for nosetests
https://github.com/manuels/nose-deadline
Last synced: about 2 months ago
JSON representation
Enforced timelimits for nosetests
- Host: GitHub
- URL: https://github.com/manuels/nose-deadline
- Owner: manuels
- License: gpl-2.0
- Created: 2016-08-15T19:44:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-15T20:30:44.000Z (over 8 years ago)
- Last Synced: 2024-11-22T15:43:50.327Z (about 2 months ago)
- Language: Python
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nose-deadline
## Description
Enforced timelimits for nosetests.## Example
from nose_deadline import deadline
@deadline(1)
def test_sleep():
import time
time.sleep(5)Then run `nosetest --with-deadline ` and you will see this error message:
T
======================================================================
Deadline exceeded.: test.test_sleep
----------------------------------------------------------------------
Traceback (most recent call last):
[...]
File "test.py", line 6, in test_sleep
time.sleep(5)
File "/home/schoellingm/tmp/nose-alarm/nose_deadline.py", line 19, in sig_handler
raise DeadlineExceeded('Test did not finish within {}sec.'.format(sec))
nose_deadline.DeadlineExceeded: Test did not finish within 1sec.----------------------------------------------------------------------
Ran 1 test in 1.001sFAILED (Deadline exceeded.=1)
## Restrictions
Only works on *nix systems because it needs POSIX signals.