I have a unittest test case in my app which needs to be py2 and py3 compatible.
class MyTest(TestCase):
def test_pep3102(self):
def fn(a, b, *, d):
pass
# do something
# assert
This test case works fine with py3 since py3 supports the signature of fn
however fails as expected in py2 due to syntax error during module loading
What's the recommended way to deal with this?
I'm thinking of moving it out to a different file and loading it if py > 3 but wanted to know if there's a cleaner solution