Fix tests for python2.
This commit is contained in:
parent
3eef4a2f8b
commit
416e154359
3 changed files with 6 additions and 4 deletions
3
Makefile
3
Makefile
|
@ -18,4 +18,5 @@ $(DESTDIR)$(PREFIX)/python/matrix/%.py: matrix/%.py phony
|
|||
install -Dm644 $< $@
|
||||
|
||||
test:
|
||||
$(PYTHON) -m pytest
|
||||
python3 -m pytest
|
||||
python2 -m pytest
|
||||
|
|
|
@ -74,16 +74,15 @@ def color(color_name):
|
|||
escape_codes.append(
|
||||
make_fg_color(weechat_base_colors[stripped_color]))
|
||||
|
||||
elif stripped_color.isdecimal():
|
||||
elif stripped_color.isdigit():
|
||||
num_color = int(stripped_color)
|
||||
if num_color >= 0 and num_color < 256:
|
||||
escape_codes.append(make_fg_color(stripped_color))
|
||||
|
||||
|
||||
if bg_color in weechat_base_colors:
|
||||
escape_codes.append(make_bg_color(weechat_base_colors[bg_color]))
|
||||
else:
|
||||
if bg_color.isdecimal():
|
||||
if bg_color.isdigit():
|
||||
num_color = int(bg_color)
|
||||
if num_color >= 0 and num_color < 256:
|
||||
escape_codes.append(make_bg_color(bg_color))
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import webcolors
|
||||
from hypothesis import given
|
||||
from hypothesis.strategies import sampled_from
|
||||
|
|
Loading…
Reference in a new issue