From 3c354772306910c768959e12cb54987dd480e9e2 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 7 Feb 2022 17:19:01 -0500 Subject: [PATCH] [7.0.x] work around test pollution caused by new setuptools mutating global logger level --- testing/test_doctest.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/testing/test_doctest.py b/testing/test_doctest.py index e85f44f93..c2c832720 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -802,11 +802,12 @@ class TestDoctests: p = pytester.makepyfile( setup=""" from setuptools import setup, find_packages - setup(name='sample', - version='0.0', - description='description', - packages=find_packages() - ) + if __name__ == '__main__': + setup(name='sample', + version='0.0', + description='description', + packages=find_packages() + ) """ ) result = pytester.runpytest(p, "--doctest-modules")