Tests failing on fresh install: TypeError in test_spi.py and test_uart.py

Open Beginner friendly
#257 3 comments 0 reactions 0 assignees View on GitHub

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:

  1. Clone repository
  2. Install dependencies: pip install -e .
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fossasia/pslab-python

All issues in fossasia/pslab-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.