fab634e3ee
This introduces a skip_if module that can be used by tests to determine when they should be skipped due to the environment. Some tests have been split in order to have finer grained skip control.
21 lines
428 B
Python
21 lines
428 B
Python
import skip_if
|
|
skip_if.no_cpython_compat()
|
|
|
|
try:
|
|
try:
|
|
from collections import namedtuple
|
|
except ImportError:
|
|
from ucollections import namedtuple
|
|
except ImportError:
|
|
skip_if.skip()
|
|
|
|
# Try single string
|
|
T3 = namedtuple("TupComma", "foo bar")
|
|
t = T3(1, 2)
|
|
print(t.foo, t.bar)
|
|
|
|
# Try single string with comma field separator
|
|
# Not implemented so far
|
|
#T2 = namedtuple("TupComma", "foo,bar")
|
|
#t = T2(1, 2)
|