Merge pull request #4 from 20-2-SKKU-OSS/Minje

Exception 발생시 color effect, testcase 추가
This commit is contained in:
yunminjin2 2020-12-05 19:31:18 +09:00 committed by GitHub
commit 804ddd44fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 2 deletions

1
.gitignore vendored
View file

@ -15,3 +15,4 @@ build/
.coverage
htmlcov
*.xml

View file

@ -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

View file

@ -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
View 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))