You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if I do a manual python shell session, I can pluralize() just fine. Similarly my application code when I run it, runs without any errors, exceptions. However when I run my unit tests for code that uses inflection.pluralize() I get the error
word = 'network'
def pluralize(word):
"""
Return the plural form of a word.
Examples::
>>> pluralize("post")
"posts"
>>> pluralize("octopus")
"octopi"
>>> pluralize("sheep")
"sheep"
>>> pluralize("CamelOctopus")
"CamelOctopi"
"""
> if not word or word.lower() in UNCOUNTABLES:
E TypeError: argument of type 'NoneType' is not iterable
/usr/local/lib/python2.7/dist-packages/inflection.py:297: TypeError
3 failed, 50 passed in 0.14 seconds
When I run my tests using py.test --pdb, I'm unable to print any value for UNCOUNTABLES
word = 'networkTopology'
def pluralize(word):
"""
Return the plural form of a word.
Examples::
>>> pluralize("post")
"posts"
>>> pluralize("octopus")
"octopi"
>>> pluralize("sheep")
"sheep"
>>> pluralize("CamelOctopus")
"CamelOctopi"
"""
> if not word or word.lower() in UNCOUNTABLES:
E TypeError: argument of type 'NoneType' is not iterable
/usr/local/lib/python2.7/dist-packages/inflection.py:297: TypeError
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> /usr/local/lib/python2.7/dist-packages/inflection.py(297)pluralize()
-> if not word or word.lower() in UNCOUNTABLES:
(Pdb) UNCOUNTABLES
(Pdb) list
292 "sheep"
293 >>> pluralize("CamelOctopus")
294 "CamelOctopi"
295
296 """
297 -> if not word or word.lower() in UNCOUNTABLES:
298 return word
299 else:
300 for rule, replacement in PLURALS:
301 if re.search(rule, word):
302 return re.sub(rule, replacement, word)
(Pdb)
I'm using inflection==0.3.1
The text was updated successfully, but these errors were encountered:
if I do a manual python shell session, I can
pluralize()
just fine. Similarly my application code when I run it, runs without any errors, exceptions. However when I run my unit tests for code that usesinflection.pluralize()
I get the errorWhen I run my tests using
py.test --pdb
, I'm unable to print any value for UNCOUNTABLESI'm using
inflection==0.3.1
The text was updated successfully, but these errors were encountered: