From 800b163cd8713df8a2b1c87f23c40eb80290d918 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 14 Feb 2017 22:22:45 +0300 Subject: [PATCH] tests/comprehension1, containment: Split set tests to separate files. To make skippable. --- tests/basics/comprehension1.py | 3 +-- tests/basics/containment.py | 3 ++- tests/basics/set_comprehension.py | 1 + tests/basics/set_containment.py | 4 ++++ 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 tests/basics/set_comprehension.py create mode 100644 tests/basics/set_containment.py diff --git a/tests/basics/comprehension1.py b/tests/basics/comprehension1.py index 7f541ee53f..892d6b4e33 100644 --- a/tests/basics/comprehension1.py +++ b/tests/basics/comprehension1.py @@ -14,7 +14,6 @@ def f(): print(d[0], d[1], d[2], d[3], d[4]) # set comprehension - - print({a for a in range(5)}) + # see set_comprehension.py f() diff --git a/tests/basics/containment.py b/tests/basics/containment.py index f8be04e929..bae3661131 100644 --- a/tests/basics/containment.py +++ b/tests/basics/containment.py @@ -1,5 +1,6 @@ +# sets, see set_containment for i in 1, 2: - for o in {1:2}, {1}, {1:2}.keys(): + for o in {1:2}, {1:2}.keys(): print("{} in {}: {}".format(i, o, i in o)) print("{} not in {}: {}".format(i, o, i not in o)) diff --git a/tests/basics/set_comprehension.py b/tests/basics/set_comprehension.py new file mode 100644 index 0000000000..12a9a29d31 --- /dev/null +++ b/tests/basics/set_comprehension.py @@ -0,0 +1 @@ +print({a for a in range(5)}) diff --git a/tests/basics/set_containment.py b/tests/basics/set_containment.py new file mode 100644 index 0000000000..97694f74c5 --- /dev/null +++ b/tests/basics/set_containment.py @@ -0,0 +1,4 @@ +for i in 1, 2: + for o in {}, {1}, {2}: + print("{} in {}: {}".format(i, o, i in o)) + print("{} not in {}: {}".format(i, o, i not in o))