mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-01-23 10:15:11 +00:00
Merge pull request #4 from 20-2-SKKU-OSS/Minje
Exception 발생시 color effect, testcase 추가
This commit is contained in:
commit
804ddd44fa
4 changed files with 22 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -15,3 +15,4 @@ build/
|
|||
|
||||
.coverage
|
||||
htmlcov
|
||||
*.xml
|
||||
|
|
|
|||
|
|
@ -505,7 +505,7 @@ class Tracer:
|
|||
exception = '\n'.join(traceback.format_exception_only(*arg[:2])).strip()
|
||||
if self.max_variable_length:
|
||||
exception = utils.truncate(exception, self.max_variable_length)
|
||||
self.write('{indent}Exception:..... {exception}'.
|
||||
self.write('\033[31m' + '{indent}Exception:..... {exception}'.
|
||||
format(**locals()))
|
||||
|
||||
return self.trace
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import itertools
|
||||
import abc
|
||||
|
||||
try:
|
||||
from collections.abc import Mapping, Sequence
|
||||
except ImportError:
|
||||
|
|
@ -47,7 +48,7 @@ class BaseVariable(pycompat.ABC):
|
|||
|
||||
def __eq__(self, other):
|
||||
return (isinstance(other, BaseVariable) and
|
||||
self._fingerprint == other._fingerprint)
|
||||
self._fingerprint == other._fingerprint)
|
||||
|
||||
|
||||
class CommonVariable(BaseVariable):
|
||||
|
|
|
|||
18
test1.py
Normal file
18
test1.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import pysnooper
|
||||
|
||||
@pysnooper.snoop()
|
||||
def bubble(number):
|
||||
a = [5, 0, 2, 3, 6, 9, 1, 7, 4]
|
||||
if number == 1:
|
||||
for i in range(0,11):
|
||||
for j in range(i, 9):
|
||||
if(a[j] < a[i]):
|
||||
temp = a[i]
|
||||
a[i] = a[j]
|
||||
a[j] = temp
|
||||
return a
|
||||
|
||||
else:
|
||||
return [0]
|
||||
|
||||
print(bubble(0))
|
||||
Loading…
Add table
Add a link
Reference in a new issue