fossasia / fossasia/pslab-python

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

Open
#257 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.6k
Forks
242
PR merge metrics
No merged PRs in 30d

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.