Commit 80b8e026 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

TEST: Test that argparse workaround works around argparse

parent 581cda3c
......@@ -1509,3 +1509,28 @@ def test_main_variables_and_visits():
got = pd.read_csv('out.txt', delimiter='\t', index_col=0)
assert np.all(got.columns == ['1-1.0', '3-1.0'])
@patch_logging
def test_main_argparse_bug_workaround():
# https://bugs.python.org/issue9334
data = tw.dedent("""
id,1-0.0,2-0.0
1,11,-10
2,12,-11
3,13,-13
4,14,-14
5,15,-15
""").strip()
with tempdir():
with open('data.txt', 'wt') as f:
f.write(data)
main.main(
shlex.split('-nb -re 2 "-10,-11" "-11,-12" out.txt data.txt'))
got = pd.read_csv('out.txt', delimiter='\t', index_col=0)
assert np.all(got['1-0.0'] == range( 11, 16))
assert np.all(got['2-0.0'] == range(-11, -16, -1))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment