Re: python-m3u8: how to get %pytest working

2022-08-09 Thread Miro Hrončok

On 09. 08. 22 16:45, Martin Gansser wrote:

Hi,

how do i get %pytest on the python-m3u8 package to work ?
I have already made several attempts which fail.

%check
#%%{pytest} -vv --cov-report term-missing --cov m3u8 tests/
#%%{__python3} -m pytest tests/m3u8server.py


Hi Martin,

It would certainly be helpful if you specified:

 - What do you expect to happen?
 - What actually happens instead?


A simple approach like this:

  %check
  %pytest -vv

Makes the test run. Three tests fail because they require internet, you need to 
deselect them:


  %check
  # 3 deselected tests require internet connection
  %pytest -vv -k "not (test_load_should_ and (uri or redirect))"

If you want to make it cool, talk to upstream and add a marker that maeks the 
tests as such, then you could use simpler:


  %check
  %pytest -vv -m "not internet"



As a side note, running --cov is discouraged:

https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters




[1] https://martinkg.fedorapeople.org/Packages/test/python-m3u8-3.1.0-1.fc36


https://martinkg.fedorapeople.org/Packages/test/python-m3u8-3.1.0-1.fc36.src.rpm

--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


python-m3u8: how to get %pytest working

2022-08-09 Thread Martin Gansser
Hi,

how do i get %pytest on the python-m3u8 package to work ?
I have already made several attempts which fail.

%check
#%%{pytest} -vv --cov-report term-missing --cov m3u8 tests/
#%%{__python3} -m pytest tests/m3u8server.py

[1] https://martinkg.fedorapeople.org/Packages/test/python-m3u8-3.1.0-1.fc36

Regards
Martin
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue