Tests failing on fresh install: TypeError in test_spi.py and test_uart.py
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- python
- Domain
- testing-qa
Research direction
Start with tests/test_spi.py and tests/test_uart.py, especially the module-level calculations using SPIMaster._frequency and UART._baudrate. Run python -m pytest after checking how those values are defined; done means test collection succeeds and the SPI and UART tests run without TypeErrors.
Written by the indexing model from the issue text.
Description
Hi! I am setting up the development environment for GSoC. While running the tests locally on Windows, I encountered errors in the SPI and UART test modules.
It appears that SPIMaster._frequency and UART._baudrate are methods (functions), but the test code attempts to multiply/divide them directly as if they were integers. This causes the test collection to fail.
Steps to reproduce the behavior:
- Clone repository
- Install dependencies:
pip install -e . - Run tests:
python -m pytest
Error Log
___________________________________________________________________ ERROR collecting tests/test_spi.py ____________________________________________________________________ tests\test_spi.py:33: in PWM_FERQUENCY = SPIMaster._frequency * 2 / 3 E TypeError: unsupported operand type(s) for *: 'method' and 'int'
___________________________________________________________________ ERROR collecting tests/test_uart.py ___________________________________________________________________ tests\test_uart.py:19: in PWM_FERQUENCY = UART._baudrate // 2 E TypeError: unsupported operand type(s) for //: 'method' and 'int'
Expected behavior
The tests should collect and run without TypeErrors.
Environment
- OS: Windows
- Python Version: 3.14.0
- Dominant language
- Python
- Stars
- 1.6k
- Forks
- 242
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fossasia/pslab-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
fossasia/pslab-python#272 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
fossasia/pslab-python#270 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
fossasia/pslab-python#285 ·
-
fossasia/pslab-python#280 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fossasia/pslab-python#273 · 4 comments ·
All issues in fossasia/pslab-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100