UCSBarchlab / PyRTL

A collection of classes providing simple hardware specification, simulation, tracing, and testing suitable for teaching and research. Simplicity, usability, clarity, and extensibility are the overarching goals, rather than performance or optimization.
http://ucsbarchlab.github.io/PyRTL
BSD 3-Clause "New" or "Revised" License
253 stars 76 forks source link

Migrate from nose to pytest and enable testing on Python 3.11. #429

Closed fdxmw closed 1 year ago

fdxmw commented 1 year ago

nose is no longer maintained, and it appears to be incompatible with Python 3.9+. Most recommendations are to migrate to pytest.

This also fixes several warnings produced by pytest:

tests/test_examples.py:17 tests/test_examples.py:17: PytestCollectionWarning: yield tests were removed in pytest 4.0 - test_all_examples will be ignored def test_all_examples():

tests/test_importexport.py:95 /Users/lauj/projects/ucsb/pyrtl/tests/test_importexport.py:95: DeprecationWarning: invalid escape sequence '\c' counter4bit_blif = """\

tests/test_importexport.py:256 /Users/lauj/projects/ucsb/pyrtl/tests/test_importexport.py:256: DeprecationWarning: invalid escape sequence '\q' clock_passing_blif = """

tests/rtllib/test_aes.py: 28 warnings /Users/lauj/projects/ucsb/pyrtl/pyrtl/simulation.py:1225: DeprecationWarning: Access to trace by WireVector instead of name is deprecated. warnings.warn(

tests/rtllib/test_aes.py: 11 warnings /Users/lauj/projects/ucsb/pyrtl/tests/rtllib/test_aes.py:108: DeprecationWarning: Please use assertEqual instead. self.assertEquals(ready_signal, 0)

tests/rtllib/test_aes.py::TestAESDecrypt::test_aes_state_machine tests/rtllib/test_aes.py::TestAESDecrypt::test_aes_state_machine /Users/lauj/projects/ucsb/pyrtl/tests/rtllib/test_aes.py:111: DeprecationWarning: Please use assertEqual instead. self.assertEquals(ready_signal, 1)

tests/rtllib/test_aes.py: 11 warnings /Users/lauj/projects/ucsb/pyrtl/tests/rtllib/test_aes.py:214: DeprecationWarning: Please use assertEqual instead. self.assertEquals(ready_signal, 0)

tests/rtllib/test_aes.py::TestAESEncrypt::test_aes_state_machine tests/rtllib/test_aes.py::TestAESEncrypt::test_aes_state_machine /Users/lauj/projects/ucsb/pyrtl/tests/rtllib/test_aes.py:217: DeprecationWarning: Please use assertEqual instead. self.assertEquals(ready_signal, 1)

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: +0.45 :tada:

Comparison is base (6e64213) 90.48% compared to head (c44a60f) 90.93%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## development #429 +/- ## =============================================== + Coverage 90.48% 90.93% +0.45% =============================================== Files 24 24 Lines 6146 6154 +8 =============================================== + Hits 5561 5596 +35 + Misses 585 558 -27 ``` [see 12 files with indirect coverage changes](https://codecov.io/gh/UCSBarchlab/PyRTL/pull/429/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UCSBarchlab)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

fdxmw commented 1 year ago

I plan to merge this in about a week, so if anyone has objections, questions, or comments please let me know soon.