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
34cd2ae6
Commit
34cd2ae6
authored
Jan 22, 2015
by
Gregory P. Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Break up TestCommandLine.test_env_var into four distinct tests.
parent
7ffa2c5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
Lib/test/test_tracemalloc.py
Lib/test/test_tracemalloc.py
+5
-3
No files found.
Lib/test/test_tracemalloc.py
View file @
34cd2ae6
...
...
@@ -748,26 +748,28 @@ class TestFilters(unittest.TestCase):
class TestCommandLine(unittest.TestCase):
def test_env_var(self):
def test_env_var
_disabled_by_default
(self):
# not tracing by default
code = '
import
tracemalloc
;
print
(
tracemalloc
.
is_tracing
())
'
ok, stdout, stderr = assert_python_ok('
-
c
', code)
stdout = stdout.rstrip()
self.assertEqual(stdout, b'
False
')
# PYTHON* environment variables must be ignored when -E option is
# present
def test_env_var_ignored_with_E(self):
"""PYTHON* environment variables must be ignored when -E is present."""
code = '
import
tracemalloc
;
print
(
tracemalloc
.
is_tracing
())
'
ok, stdout, stderr = assert_python_ok('
-
E
', '
-
c
', code, PYTHONTRACEMALLOC='
1
')
stdout = stdout.rstrip()
self.assertEqual(stdout, b'
False
')
def test_env_var_enabled_at_startup(self):
# tracing at startup
code = '
import
tracemalloc
;
print
(
tracemalloc
.
is_tracing
())
'
ok, stdout, stderr = assert_python_ok('
-
c
', code, PYTHONTRACEMALLOC='
1
')
stdout = stdout.rstrip()
self.assertEqual(stdout, b'
True
')
def test_env_limit(self):
# start and set the number of frames
code = '
import
tracemalloc
;
print
(
tracemalloc
.
get_traceback_limit
())
'
ok, stdout, stderr = assert_python_ok('
-
c
', code, PYTHONTRACEMALLOC='
10
')
...
...
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