2010-11-13 18:10:45 +08:00
|
|
|
"""
|
2012-09-25 17:58:41 +08:00
|
|
|
pytest: unit and functional testing with Python.
|
2010-11-13 18:10:45 +08:00
|
|
|
"""
|
|
|
|
__all__ = ['main']
|
|
|
|
|
|
|
|
if __name__ == '__main__': # if run as a script or by 'python -m pytest'
|
2012-09-25 17:58:41 +08:00
|
|
|
# we trigger the below "else" condition by the following import
|
|
|
|
import pytest
|
|
|
|
raise SystemExit(pytest.main())
|
2010-11-13 18:10:45 +08:00
|
|
|
else:
|
2012-09-25 17:58:41 +08:00
|
|
|
# we are simply imported
|
|
|
|
from _pytest.core import main, UsageError, _preloadplugins
|
|
|
|
from _pytest import core as cmdline
|
|
|
|
from _pytest import __version__
|
2010-11-13 18:10:45 +08:00
|
|
|
_preloadplugins() # to populate pytest.* namespace so help(pytest) works
|