Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
edcac8f4
Commit
edcac8f4
authored
Aug 03, 2004
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make sure distutils logging is shut off in tests to avoid spurious output
parent
1fa649f2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
3 deletions
+25
-3
Lib/distutils/log.py
Lib/distutils/log.py
+3
-0
Lib/distutils/tests/support.py
Lib/distutils/tests/support.py
+13
-0
Lib/distutils/tests/test_build_py.py
Lib/distutils/tests/test_build_py.py
+3
-1
Lib/distutils/tests/test_build_scripts.py
Lib/distutils/tests/test_build_scripts.py
+3
-1
Lib/distutils/tests/test_install_scripts.py
Lib/distutils/tests/test_install_scripts.py
+3
-1
No files found.
Lib/distutils/log.py
View file @
edcac8f4
...
...
@@ -50,7 +50,10 @@ error = _global_log.error
fatal
=
_global_log
.
fatal
def
set_threshold
(
level
):
# return the old threshold for use from tests
old
=
_global_log
.
threshold
_global_log
.
threshold
=
level
return
old
def
set_verbosity
(
v
):
if
v
<=
0
:
...
...
Lib/distutils/tests/support.py
View file @
edcac8f4
...
...
@@ -3,6 +3,19 @@
import
shutil
import
tempfile
from
distutils
import
log
class
LoggingSilencer
(
object
):
def
setUp
(
self
):
super
(
LoggingSilencer
,
self
).
setUp
()
self
.
threshold
=
log
.
set_threshold
(
log
.
FATAL
)
def
tearDown
(
self
):
log
.
set_threshold
(
self
.
threshold
)
super
(
LoggingSilencer
,
self
).
tearDown
()
class
TempdirManager
(
object
):
"""Mix-in class that handles temporary directories for test cases.
...
...
Lib/distutils/tests/test_build_py.py
View file @
edcac8f4
...
...
@@ -9,7 +9,9 @@ from distutils.core import Distribution
from
distutils.tests
import
support
class
BuildPyTestCase
(
support
.
TempdirManager
,
unittest
.
TestCase
):
class
BuildPyTestCase
(
support
.
TempdirManager
,
support
.
LoggingSilencer
,
unittest
.
TestCase
):
def
test_package_data
(
self
):
sources
=
self
.
mkdtemp
()
...
...
Lib/distutils/tests/test_build_scripts.py
View file @
edcac8f4
...
...
@@ -9,7 +9,9 @@ from distutils.core import Distribution
from
distutils.tests
import
support
class
BuildScriptsTestCase
(
support
.
TempdirManager
,
unittest
.
TestCase
):
class
BuildScriptsTestCase
(
support
.
TempdirManager
,
support
.
LoggingSilencer
,
unittest
.
TestCase
):
def
test_default_settings
(
self
):
cmd
=
self
.
get_build_scripts_cmd
(
"/foo/bar"
,
[])
...
...
Lib/distutils/tests/test_install_scripts.py
View file @
edcac8f4
...
...
@@ -9,7 +9,9 @@ from distutils.core import Distribution
from
distutils.tests
import
support
class
InstallScriptsTestCase
(
support
.
TempdirManager
,
unittest
.
TestCase
):
class
InstallScriptsTestCase
(
support
.
TempdirManager
,
support
.
LoggingSilencer
,
unittest
.
TestCase
):
def
test_default_settings
(
self
):
dist
=
Distribution
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment