qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/5] python: add pytest and tests


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 1/5] python: add pytest and tests
Date: Wed, 28 Oct 2020 15:09:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1

On 10/28/20 2:23 PM, John Snow wrote:
> On 10/28/20 2:19 AM, Thomas Huth wrote:
>> On 27/10/2020 23.38, John Snow wrote:
>>> Try using pytest to manage our various tests; even though right now
>>> they're only invoking binaries and not really running any python-native
>>> code.
>>>
>>> Create tests/, and add test_lint.py which calls out to mypy, flake8,
>>> pylint and isort to enforce the standards in this directory.
>>>
>>> Add pytest to the setup.cfg development dependencies; add a pytest
>>> configuration section as well; run it in verbose mode.
>>>
>>> Finally, add pytest to the Pipfile environment and lock the new
>>> dependencies. (Note, this also updates an unrelated dependency; but the
>>> only way to avoid this is to pin that dependency at a lower version --
>>> which there is no reason to do at present.)
>>>
>>> Provided you have the right development dependencies (mypy, flake8,
>>> isort, pylint, and now pytest) You should be able to run "pytest" from
>>> the python folder to run all of these linters with the correct
>>> arguments.
>>>
>>> Signed-off-by: John Snow <jsnow@redhat.com>
>>> ---
>>>   python/Pipfile.lock       | 71 ++++++++++++++++++++++++++++++++++++---
>>>   python/setup.cfg          |  5 +++
>>>   python/tests/test_lint.py | 28 +++++++++++++++
>>>   3 files changed, 99 insertions(+), 5 deletions(-)
>>>   create mode 100644 python/tests/test_lint.py
>>>
>>> diff --git a/python/Pipfile.lock b/python/Pipfile.lock
>>> index 05077475d750..105ffbc09a8e 100644
>>> --- a/python/Pipfile.lock
>>> +++ b/python/Pipfile.lock
>>> @@ -30,6 +30,14 @@
>>>               "markers": "python_version >= '3.5'",
>>>               "version": "==2.4.2"
>>>           },
>>> +        "attrs": {
>>> +            "hashes": [
>>> +               
>>> "sha256:26b54ddbbb9ee1d34d5d3668dd37d6cf74990ab23c828c2888dccdceee395594",
>>>
>>> +               
>>> "sha256:fce7fc47dfc976152e82d53ff92fa0407700c21acd20886a13777a0d20e655dc"
>>>
>>> +            ],
>>> +            "markers": "python_version >= '2.7' and python_version
>>> not in '3.0, 3.1, 3.2, 3.3'",
>>
>> Can't you simply use "python_version >= '3.6'" instead?
>>
>>   Thomas
>>
> 
> This file is generated; I don't really actually know what these markers
> mean or to whom. I can't edit it because it's checksummed.

We should remember to add a line such "The Pipfile.lock content
is generated" in the commit message each time it is modified after
a change in setup.cfg :)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]