We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7da112f commit e02dcdcCopy full SHA for e02dcdc
tests/test_text.py
@@ -7,6 +7,8 @@
7
# See https://aboutcode.org for more information about nexB OSS projects.
8
#
9
10
+import pytest
11
+
12
from commoncode import text
13
from commoncode.text import CR
14
from commoncode.text import LF
@@ -85,12 +87,11 @@ def test_python_safe_name():
85
87
assert text.python_safe_name(s2) == text.python_safe_name(s1)
86
88
89
90
91
def test_as_unicode():
92
assert text.as_unicode("") == ""
93
assert isinstance(text.as_unicode(b"some bytes"), str)
- assert text.as_unicode(None) == None
- try:
94
+ assert text.as_unicode(None) is None
95
96
+ with pytest.raises(TypeError):
97
text.as_unicode(["foo"])
- raise Exception("Exception should have been raised")
- except AssertionError:
- pass
0 commit comments