I have a module TestEndToEndDemo.py in a Python package tests/.
When I run pytest tests/*, the module is collected twice and each test within it run twice because of that, but when I run pytest tests/TestEndToEndDemo.py, the tests are executed only once.
There is one @pytest.fixture function used for dependency injection, and two @staticmethod test cases.
The tests/ module contains an empty init.py file.
Pytest --version 7.1.2
Python3 --version 3.10.4
SOLVED:
pytest tests instead of pytest tests/* removed the duplicates.
Pytest collects a module twice with regex '*' argument