Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: also test on python 3.10, switch to pytest #2142

Merged
merged 8 commits into from
Feb 1, 2022
Merged

Conversation

sebix
Copy link
Member

@sebix sebix commented Jan 25, 2022

No description provided.

@sebix sebix added this to the 3.1.0 milestone Jan 25, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2022

Codecov Report

Merging #2142 (8d7c6a3) into develop (134d6f0) will increase coverage by 0.41%.
The diff coverage is 100.00%.

❗ Current head 8d7c6a3 differs from pull request most recent head 0a9a6db. Consider uploading reports for the commit 0a9a6db to get more accurate results

@@             Coverage Diff             @@
##           develop    #2142      +/-   ##
===========================================
+ Coverage    75.93%   76.34%   +0.41%     
===========================================
  Files          440      441       +1     
  Lines        23630    23649      +19     
  Branches      3439     3737     +298     
===========================================
+ Hits         17943    18055     +112     
+ Misses        4956     4857      -99     
- Partials       731      737       +6     
Impacted Files Coverage Δ
intelmq/lib/test.py 91.66% <ø> (+0.15%) ⬆️
intelmq/tests/bots/experts/jinja/test_expert.py 100.00% <100.00%> (ø)
...bots/parsers/fraunhofer/ddosattack_tests_common.py 0.00% <0.00%> (-42.11%) ⬇️
...xperts/national_cert_contact_certat/test_expert.py 60.71% <0.00%> (-7.15%) ⬇️
...elmq/tests/bots/experts/cymru_whois/test_expert.py 47.82% <0.00%> (-6.53%) ⬇️
intelmq/tests/bots/experts/abusix/test_expert.py 51.61% <0.00%> (-6.46%) ⬇️
intelmq/tests/bots/collectors/rt/test_collector.py 72.50% <0.00%> (-5.00%) ⬇️
intelmq/tests/bots/experts/uwhoisd/test_expert.py 57.14% <0.00%> (-4.77%) ⬇️
intelmq/tests/bots/experts/lookyloo/test_expert.py 58.33% <0.00%> (-4.17%) ⬇️
...ntelmq/tests/bots/experts/do_portal/test_expert.py 49.01% <0.00%> (-3.93%) ⬇️
... and 54 more

@sebix
Copy link
Member Author

sebix commented Jan 25, 2022

nosetest doesn't support Python 3.10 -> We can use unittest itself for running the test or pytest

@sebix sebix changed the title TST: also test on python 3.10 TST: also test on python 3.10, switch to pytest Jan 27, 2022
nose does not support Python 3.10 and is deprecated.
pytest also gives good and nice output, so use this instead in the
GitHub Action and in the docs
@sebix sebix force-pushed the python-3.10 branch 2 times, most recently from dc7898e to eb4be3d Compare January 27, 2022 22:04
- coverage settings
- don't capture warnings, as then logging would not be able to capture
  them, causing test fails
  see https://docs.pytest.org/en/6.2.x/warnings.html#disabling-warning-capture-entirely
apparently nose dependes on jinja2 and installed jinja2 implicitly
support the initialization logging message on python 3.10
Python 3.10 returns such a version info:
python 3.10.2 (main, Jan 16 2022, 11:55:27) [GCC 9.3.0]
the gcc version is now
extend the regex to catch this and make it more generic, less complex
- the __init__.py was missing. this was the reason that this test was
  never executed before with nose
- set the overwrite parameter to test the behaviour actually
the old code assumed that there were no command line arguments to the
calling program.
now set the arguments explicitly to []
@sebix
Copy link
Member Author

sebix commented Jan 28, 2022

pytest by default captures all warnings, but we also want to test in our unittest if the capturing of warnings by the logging works. For a simple solution and to keep this PR focused, I chose to disable the warnings capturing in pytest.

@aaronkaplan Can you please set the nosetests as optional (not required) in the GitHub settings? Thanks.

@aaronkaplan
Copy link
Member

looks good. IMHO we can merge.

@aaronkaplan aaronkaplan merged commit 1dc5364 into develop Feb 1, 2022
@sebix sebix deleted the python-3.10 branch February 1, 2022 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants