def test_remove_nans():
    tests = [((1, 1, 2), (1, 1, 2)), ((None, 1, 2), (1, 1, 2)), ((1, None, 2), (1, 2, 2)), ((1, 2, None), (1, 2, 2)), ((1, 2, None, None), (1, 2, 2, 2)), ((None, None, 1, 2), (1, 1, 1, 2)), ((1, None, None, 2), (1, 2, 2, 2)), ((None, 1, None, 2, None, 3, None), (1, 1, 2, 2, 3, 3, 3))]
    converters = [(int, np.nan), (float, np.nan), (str, np.nan), ((lambda x: pd.to_datetime(x, unit='ns')), np.datetime64('NaT'))]
    for (conv, none_val) in converters:
        for (inputs, expected) in tests:
            params = [(none_val if (x is None) else conv(x)) for x in inputs]
            expected = [conv(x) for x in expected]
            assert (remove_nans(params) == expected)
def test_remove_nans():
    tests = [((1, 1, 2), (1, 1, 2)), ((None, 1, 2), (1, 1, 2)), ((1, None, 2), (1, 2, 2)), ((1, 2, None), (1, 2, 2)), ((1, 2, None, None), (1, 2, 2, 2)), ((None, None, 1, 2), (1, 1, 1, 2)), ((1, None, None, 2), (1, 2, 2, 2)), ((None, 1, None, 2, None, 3, None), (1, 1, 2, 2, 3, 3, 3))]
    converters = [(int, np.nan), (float, np.nan), (str, np.nan), ((lambda x: pd.to_datetime(x, unit='ns')), np.datetime64('NaT'))]
    for (conv, none_val) in converters:
        for (inputs, expected) in tests:
            params = [(none_val if (x is None) else conv(x)) for x in inputs]
            expected = [conv(x) for x in expected]
            assert (remove_nans(params) == expected)