[PATCH 2/2] Add a message to run 'pytest' to run rest of test suite.

Amar Takhar amar at rtems.org
Mon Mar 16 19:17:32 UTC 2020


On 2020-03-16 09:34 +0100, Sebastian Huber wrote:
> On 16/03/2020 00:57, Amar Takhar wrote:
> 
>     On 2020-03-16 09:20 +1100, Chris Johns wrote:
> 
>         Is pytest installed by default?
> 
>     No.  It's a separate package the Python has 'unittest' which is shipped by
>     default.  For our usage pyttest is more flexible and will create concise code
>     that is easy to contribute to.  The biggest reason is that it's more suited to
>     our use.
> 
> From the website pytest requires Python 3.5+ and PyPy 3. This is not a problem
> for me in general. We still would like to be compatible to Python 2.7, how can
> we run the tests in such an environment with pytest?

It works on pytest using any Python 2.7+:

verm at peach# pytest-2.7 --version
This is pytest version 4.5.0, imported from 
/usr/local/lib/python2.7/site-packages/pytest.pyc


verm at peach# pytest --version
This is pytest version 4.5.0, imported from 
/usr/local/lib/python3.7/site-packages/pytest.py


Python 2.x support is not going to go away for a while yet.


> What is the relationship to the standard Python unittest module? Do you want to
> write the tests with unittest and run them with pytest?

No, pytest uses an entirely different methodology.  This gives an OK overview of 
the differences between the two:

  https://www.slant.co/versus/9148/9149/~unittest_vs_pytest 


It's more suited to our requirements and the ability to do group fixtures is 
fantastic for testing cross platform support among other scenarios.


Amar.


More information about the devel mailing list