Let users configure dist mode in the configuration file

Fix #789
This commit is contained in:
Bruno Oliveira
2022-11-30 13:57:04 -03:00
parent c6bcd204ea
commit 7a0bc4c1c9
3 changed files with 38 additions and 7 deletions

View File

@@ -1561,3 +1561,21 @@ def test_collection_crash(testdir):
"*= 1 error in *",
]
)
def test_dist_in_addopts(testdir):
"""Users can set a default distribution in the configuration file (#789)."""
testdir.makepyfile(
"""
def test():
pass
"""
)
testdir.makeini(
"""
[pytest]
addopts = --dist loadscope
"""
)
result = testdir.runpytest()
assert result.ret == 0