Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-p no:randomly causing tests to fail under Python 3.8 and 3.9 #647

Open
alexandrul opened this issue Sep 14, 2024 · 1 comment
Open

-p no:randomly causing tests to fail under Python 3.8 and 3.9 #647

alexandrul opened this issue Sep 14, 2024 · 1 comment

Comments

@alexandrul
Copy link

Python Version

3.9.20

pytest Version

8.3.2

Package Version

3.15.0

Description

As you can see in the following table, having pytest-randomly installed and using -p no:randomly results in failed tests but only under Python 3.8 and 3.9:

Python 3.8 / 3.9 Python 3.10 / 3.11 / 3.12
pytest -p no:randomly tests/test_jsonreport.py::test_report_collectors fail pass
pytest tests/test_jsonreport.py::test_report_collectors pass pass

To replicate the issue, checkout this repo and run the above commands in a Python 3.9 virtualenv.

@alexandrul
Copy link
Author

Output for passing tests:

❯ pytest tests/test_jsonreport.py::test_report_collectors
======================================== test session starts =========================================
platform linux -- Python 3.9.20, pytest-8.3.2, pluggy-1.5.0
Using --randomly-seed=2524090775
rootdir: ~/pytest-json-report-wip-3.9/repo
plugins: metadata-3.1.1, anyio-4.4.0, randomly-3.15.0, xdist-3.6.1, flaky-3.8.1, json-report-wip-1.5.1
collected 3 items                                                                                    

tests/test_jsonreport.py ...                                                                   [100%]

========================================= 3 passed in 0.87s ==========================================

Output for failing tests:

❯ pytest -p no:randomly tests/test_jsonreport.py::test_report_collectors
======================================== test session starts =========================================
platform linux -- Python 3.9.20, pytest-8.3.2, pluggy-1.5.0
rootdir: ~/pytest-json-report-wip-3.9/repo
plugins: metadata-3.1.1, anyio-4.4.0, xdist-3.6.1, flaky-3.8.1, json-report-wip-1.5.1
collected 3 items                                                                                    

tests/test_jsonreport.py .FF                                                                   [100%]

============================================== FAILURES ==============================================
...
==================================== 2 failed, 1 passed in 0.24s =====================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant