Pytest authoritative guide -03 original TestSuite execution method

Original TestSuite execution method

Pytest can be used with most existing test suite (testsuite), but not its loading nose manner or default frame unit test test runner's Python (test runner).

Before using this section, you will need to install pytest.

Use pytest run existing test suite (test suite)

Suppose you want to contribute code to my existing warehouse (respsitory) somewhere. Using some version control software code and pull you set up virtualenvthe (optional), you need to run:

cd <仓库名>
pip install -e . # 环境所依赖的'python setup.py develop' 和 'conda develop'包

In the root directory of your project, your code which will site-packagesset up a symbolic link to allow you need to install your own code to perform the test.

So used in development mode, you can avoid re-install every time you want to run tests, this ratio each time sys.paththe test point to the local code more simple.

Or you might consider using [tox.

Translator's Note: The actual official did not write Pytest how to perform TestSuite, execution method can refer to the individual's another article: [ https://www.jianshu.com/p/6a05ccd3ca94

Guess you like

Origin www.cnblogs.com/superhin/p/11455351.html