Skip to content

Commit 048a10b

Browse files
authored
Merge pull request #9648 from pytest-dev/backport-9638-to-7.0.x
[7.0.x] work around test pollution caused by new setuptools mutating global logger level
2 parents 5eb4d69 + 3c35477 commit 048a10b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

testing/test_doctest.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,12 @@ def test_valid_setup_py(self, pytester: Pytester):
802802
p = pytester.makepyfile(
803803
setup="""
804804
from setuptools import setup, find_packages
805-
setup(name='sample',
806-
version='0.0',
807-
description='description',
808-
packages=find_packages()
809-
)
805+
if __name__ == '__main__':
806+
setup(name='sample',
807+
version='0.0',
808+
description='description',
809+
packages=find_packages()
810+
)
810811
"""
811812
)
812813
result = pytester.runpytest(p, "--doctest-modules")

0 commit comments

Comments
 (0)