From 0995d1762c21b1af6827431dc7eb87f648b0c7d3 Mon Sep 17 00:00:00 2001
From: Daniel Williams <daniel.williams@ligo.org>
Date: Fri, 27 Sep 2019 12:34:18 +0100
Subject: [PATCH] It helps a lot when you write your tests properly...

---
 bilby/core/utils.py | 2 +-
 test/utils_test.py  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bilby/core/utils.py b/bilby/core/utils.py
index 849ba8884..6bbd3c4d2 100644
--- a/bilby/core/utils.py
+++ b/bilby/core/utils.py
@@ -125,7 +125,7 @@ def _infer_args_from_function_except_n_args(func, n=1):
         parameters = inspect.getfullargspec(func).args
     except AttributeError:
         parameters = inspect.getargspec(func).args
-    del(parameters[:(n - 1)])
+    del(parameters[:n])
     return parameters
 
 
diff --git a/test/utils_test.py b/test/utils_test.py
index eb7aaa147..193392276 100644
--- a/test/utils_test.py
+++ b/test/utils_test.py
@@ -69,7 +69,7 @@ class TestInferParameters(unittest.TestCase):
             return None
 
         class TestClass:
-            def test_method(self, a, b, *args, **kwargs):
+            def test_method(self, freqs, a, b, *args, **kwargs):
                 pass
 
         self.source1 = source_function
-- 
GitLab