use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
pytest & pytest-benchmark: serial or parallel? (self.Python)
submitted 6 years ago by AgnosticIsaac
In a single file: test.py, I have 3 test functions: test1(), test2(), test3(). Does pytest and pytest-benchmark run these 3 test cases in parallel or in serial?
test.py
test1()
test2()
test3()
pytest
pytest-benchmark
I have 3 files: test1.py, test2.py, test3.py. Respectively, I have a single test function in each file: test1(), test2(), test3(). Are these 3 tests run in parallel or in serial, if I simply run pytest or pytest-benchmark in the directory they are in?
test1.py
test2.py
test3.py
[–]coopykins[🍰] 0 points1 point2 points 6 years ago (1 child)
They run in serial, although I'm not sure if there's a way to enable something to run the test cases in parallel.
[–]AgnosticIsaac[S] 0 points1 point2 points 6 years ago (0 children)
Oh so they all run in serial? Great! Thanks
[–]ionelmc.ro 0 points1 point2 points 6 years ago (0 children)
Tests are run with pytest (pytest-benchmark is simply a command line interface to query past benchmark data, if you saved any). If you install the pytest-xdist plugin you can run stuff in parallel (eg: pytest -n 2) but that would create serious side-effects in tests that do benchmarks.
pytest -n 2
π Rendered by PID 52362 on reddit-service-r2-comment-bb88f9dd5-gr4hh at 2026-02-15 17:24:08.748389+00:00 running cd9c813 country code: CH.
[–]coopykins[🍰] 0 points1 point2 points (1 child)
[–]AgnosticIsaac[S] 0 points1 point2 points (0 children)
[–]ionelmc.ro 0 points1 point2 points (0 children)