Skip to content

Commit

Permalink
Removed test for isascii to be compatible with Python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Tails86 committed Apr 22, 2024
1 parent 63da0bf commit 4e6f300
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/ansi_string/ansi_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,9 @@ def isalpha(self) -> bool:
return self._s.isalpha()

def isascii(self) -> bool:
'''
This is only available for Python >=3.7
'''
return self._s.isascii()

def isdecimal(self) -> bool:
Expand Down
7 changes: 4 additions & 3 deletions tests/test_ansi_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,10 @@ def test_is_identifier_true(self):
s = AnsiString('AnsiString', AnsiFormat.rgb(0, 0, 0))
self.assertTrue(s.isidentifier())

def test_is_ascii_true(self):
s = AnsiString('1', AnsiFormat.rgb(0, 0, 0))
self.assertTrue(s.isascii())
# Removed this test to be compatible with Python 3.6
# def test_is_ascii_true(self):
# s = AnsiString('1', AnsiFormat.rgb(0, 0, 0))
# self.assertTrue(s.isascii())

def test_is_alpha_true(self):
s = AnsiString('a', AnsiFormat.rgb(0, 0, 0))
Expand Down

0 comments on commit 4e6f300

Please sign in to comment.