From dde5508ea6dba400c48db5bfafee7747bb59ae34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fritze?= <47802+renefritze@users.noreply.github.com> Date: Thu, 5 Aug 2021 10:09:08 +0200 Subject: Conditional test pickle (#935) * [tests] adds a test for conditional definition lookup * [tests] duplicate the conditional def test into a sub package * add pyMOR example code and change test to only check for Uninferable Co-authored-by: Pierre Sassoulas --- tests/testdata/python3/data/conditional.py | 6 ++++++ tests/testdata/python3/data/conditional_import/__init__.py | 11 +++++++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/testdata/python3/data/conditional.py create mode 100644 tests/testdata/python3/data/conditional_import/__init__.py (limited to 'tests/testdata/python3/data') diff --git a/tests/testdata/python3/data/conditional.py b/tests/testdata/python3/data/conditional.py new file mode 100644 index 00000000..8f607c23 --- /dev/null +++ b/tests/testdata/python3/data/conditional.py @@ -0,0 +1,6 @@ +from data.conditional_import import ( + dump, + # dumps, + # load, + # loads, +) \ No newline at end of file diff --git a/tests/testdata/python3/data/conditional_import/__init__.py b/tests/testdata/python3/data/conditional_import/__init__.py new file mode 100644 index 00000000..38306e34 --- /dev/null +++ b/tests/testdata/python3/data/conditional_import/__init__.py @@ -0,0 +1,11 @@ + +from pprint import pformat + +if False: + + def dump(obj, file, protocol=None): + pass + +else: + from functools import partial + dump = partial(pformat, indent=0) -- cgit v1.2.1