Latest version
Released:
Invoke py.test as distutils command with dependency resolution
Jan 29, 2017 HtmlTest runner is a unittest test runner that save test results in Html files, for human readable presentation of results. This Package was inspired in unittest-xml-reporting and HtmlTestRunner by tungwaiyip. The unittest test framework is python’s xUnit style framework. Method: White Box Testing method is used for Unit testing. OOP concepts supported by unittest framework: test fixture: A test fixture is used as a baseline for running tests to ensure that there is a fixed environment in which tests are run so that results are repeatable. This tool allows you to run any Python demo code online and helps you to test any python code from your browser without any configuration. This tool provides you any Python version from Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 and runs your Python code in our sandbox environment. Python Test Explorer for Visual Studio Code. This extension allows you to run your Python Unittest, Pytest or Testplan tests with the Test Explorer UI. Getting started. Install the extension.
Project description
Setup scripts can use pytest-runner to add setup.py test support for pytestrunner.
Deprecation Notice
pytest-runner depends on deprecated features of setuptools and relies on features that break securitymechanisms in pip. For example ‘setup_requires’ and ‘tests_require’ bypass pip --require-hashes.See also pypa/setuptools#1684.
It is recommended that you:
- Remove 'pytest-runner' from your setup_requires, preferably removing the setup_requires option.
- Remove 'pytest' and any other testing requirements from tests_require, preferably removing the tests_requires option.
- Select a tool to bootstrap and then run tests such as tox.
Usage
- Add ‘pytest-runner’ to your ‘setup_requires’. Pin to ‘>=2.0,<3dev’ (orsimilar) to avoid pulling in incompatible versions.
- Include ‘pytest’ and any other testing requirements to ‘tests_require’.
- Invoke tests with setup.py pytest.
- Pass --index-url to have test requirements downloaded from an alternateindex URL (unnecessary if specified for easy_install in setup.cfg).
- Pass additional py.test command-line options using --addopts.
- Set permanent options for the python setup.py pytest command (like index-url)in the [pytest] section of setup.cfg.
- Set permanent options for the py.test run (like addopts or pep8ignore) in the [pytest]section of pytest.ini or tox.ini or put them in the [tool:pytest]section of setup.cfg. See pytest issue 567.
- Optionally, set test=pytest in the [aliases] section of setup.cfgto cause python setup.py test to invoke pytest.
Example
The most simple usage looks like this in setup.py:
Additional dependencies require to run the tests (e.g. mock or pytestplugins) may be added to tests_require and will be downloaded andrequired by the session before invoking pytest.
Follow this search on githubfor examples of real-world usage.
Standalone Example
This technique is deprecated - if you have standalone scriptsyou wish to invoke with dependencies, use pip-run.
Although pytest-runner is typically used to add pytest testrunner support to maintained packages, pytest-runner mayalso be used to create standalone tests. Consider this examplefailure,reported in jsonpickle #117or this MongoDB testdemonstrating a technique that works even when dependenciesare required in the test.
Either example file may be cloned or downloaded and simply run onany system with Python and Setuptools. It will download thespecified dependencies and run the tests. Afterward, the thecloned directory can be removed and with it all trace ofinvoking the test. No other dependencies are needed and nosystem configuration is altered.
Then, anyone trying to replicate the failure can do so easilyand with all the power of pytest (rewritten assertions,rich comparisons, interactive debugging, extensibility throughplugins, etc).
As a result, the communication barrier for describing andreplicating failures is made almost trivially low.
Considerations
Conditional Requirement
Because it uses Setuptools setup_requires, pytest-runner will install itselfon every invocation of setup.py. In some cases, this causes delays forinvocations of setup.py that will never invoke pytest-runner. To help avoidthis contingency, consider requiring pytest-runner only when pytestis invoked:
Security Contact
To report a security vulnerability, please use theTidelift security contact.Tidelift will coordinate the fix and disclosure.
Release historyRelease notifications | RSS feed
5.3.1
5.3.0
5.2
5.1
5.0
4.5.1
4.4
4.3.1
4.2
4.1
4.0
3.0.1
3.0
2.12.2
2.12.1
2.12
2.11.1
2.11
2.10.1
2.10
2.9
2.8
2.7.1
2.7
2.6.3
2.6.2
2.6.1
2.6
2.5.1
2.5
2.4
2.3
2.2.1
2.2
2.1.2
2.1.1
2.1
2.0
1.2
1.1
1.1b1 pre-release
1.0
1.0b2 pre-release
1.0dev pre-release
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size pytest_runner-5.3.1-py3-none-any.whl (7.1 kB) | File type Wheel | Python version py3 | Upload date | Hashes |
Filename, size pytest-runner-5.3.1.tar.gz (16.3 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for pytest_runner-5.3.1-py3-none-any.whl
Algorithm | Hash digest |
---|---|
SHA256 | 85f93af814438ee322b4ea08fe3f5c2ad53b253577f3bd84b2ad451fee450ac5 |
MD5 | 690a56f0d74926fee527467201ad0594 |
BLAKE2-256 | f4f56605d73bf3f4c198915872111b10c4b3c2dccd8485f47b7290ceef037190 |
Python Test Runner Gui
Hashes for pytest-runner-5.3.1.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | 0fce5b8dc68760f353979d99fdd6b3ad46330b6b1837e2077a89ebcf204aac91 |
MD5 | f87d06b0bcea00279dfdf6cc32bf0fd0 |
BLAKE2-256 | 2a04c3223812b3427ffa95110c5781eae7fe8bc3e9e1fe4e2328bee17b9e5820 |
Install Python Interpreter Windows 10
Adds support for running Django tests in Visual Studio Code. Provides shortcuts to run closest method, class, file, app and previous tests. Provides support for Django-Nose in settings.Draws inspiration from vscode-django-tests and vim-python-test-runner. FeaturesDefault shortcuts: VSCodevim keybindings (put these in your settings.json file): RequirementsRequires manage.py to be in the root workspace directory, otherwise add a cd command to the Extension SettingsThis extension contributes the following settings:
Known Issues
Open a issue/feature request and more at the github repository Release NotesAdds support for running Django Tests a multitude of ways such as by method or class. Supports Django-Nose syntax, test flags, and prefix commands. 1.0.0Initial release of Django Test Runner |