Show More
@@ -3178,7 +3178,7 b' class InteractiveShell(SingletonConfigurable):' | |||
|
3178 | 3178 | ns = {} |
|
3179 | 3179 | import_pylab(ns, import_all) |
|
3180 | 3180 | # warn about clobbered names |
|
3181 |
ignored = |
|
|
3181 | ignored = {"__builtins__"} | |
|
3182 | 3182 | both = set(ns).intersection(self.user_ns).difference(ignored) |
|
3183 | 3183 | clobbered = [ name for name in both if self.user_ns[name] is not ns[name] ] |
|
3184 | 3184 | self.user_ns.update(ns) |
@@ -63,7 +63,7 b' class Test_magic_run_completer(unittest.TestCase):' | |||
|
63 | 63 | event = MockEvent(u"%run aa") |
|
64 | 64 | mockself = None |
|
65 | 65 | match = set(magic_run_completer(mockself, event)) |
|
66 |
self.assertEqual(match, |
|
|
66 | self.assertEqual(match, {u"aao.py"}) | |
|
67 | 67 | |
|
68 | 68 | def test_3(self): |
|
69 | 69 | """Test magic_run_completer with unterminated " """ |
@@ -109,7 +109,7 b' class Test_magic_run_completer_nonascii(unittest.TestCase):' | |||
|
109 | 109 | event = MockEvent(u"%run a") |
|
110 | 110 | mockself = None |
|
111 | 111 | match = set(magic_run_completer(mockself, event)) |
|
112 |
self.assertEqual(match, |
|
|
112 | self.assertEqual(match, {u"a.py", u"aaø.py"}) | |
|
113 | 113 | |
|
114 | 114 | @onlyif_unicode_paths |
|
115 | 115 | def test_2(self): |
@@ -118,7 +118,7 b' class Test_magic_run_completer_nonascii(unittest.TestCase):' | |||
|
118 | 118 | event = MockEvent(u"%run aa") |
|
119 | 119 | mockself = None |
|
120 | 120 | match = set(magic_run_completer(mockself, event)) |
|
121 |
self.assertEqual(match, |
|
|
121 | self.assertEqual(match, {u"aaø.py"}) | |
|
122 | 122 | |
|
123 | 123 | @onlyif_unicode_paths |
|
124 | 124 | def test_3(self): |
@@ -126,14 +126,14 b' class Test_magic_run_completer_nonascii(unittest.TestCase):' | |||
|
126 | 126 | event = MockEvent(u'%run "a') |
|
127 | 127 | mockself = None |
|
128 | 128 | match = set(magic_run_completer(mockself, event)) |
|
129 |
self.assertEqual(match, |
|
|
129 | self.assertEqual(match, {u"a.py", u"aaø.py"}) | |
|
130 | 130 | |
|
131 | 131 | # module_completer: |
|
132 | 132 | |
|
133 | 133 | def test_import_invalid_module(): |
|
134 | 134 | """Testing of issue https://github.com/ipython/ipython/issues/1107""" |
|
135 |
invalid_module_names = |
|
|
136 |
valid_module_names = |
|
|
135 | invalid_module_names = {'foo-bar', 'foo:bar', '10foo'} | |
|
136 | valid_module_names = {'foobar'} | |
|
137 | 137 | with TemporaryDirectory() as tmpdir: |
|
138 | 138 | sys.path.insert( 0, tmpdir ) |
|
139 | 139 | for name in invalid_module_names | valid_module_names: |
@@ -645,12 +645,12 b' class TestAstTransform(unittest.TestCase):' | |||
|
645 | 645 | |
|
646 | 646 | with tt.AssertPrints("best of "): |
|
647 | 647 | ip.run_line_magic("timeit", "-n1 f(1)") |
|
648 |
self.assertEqual(called, |
|
|
648 | self.assertEqual(called, {-1}) | |
|
649 | 649 | called.clear() |
|
650 | 650 | |
|
651 | 651 | with tt.AssertPrints("best of "): |
|
652 | 652 | ip.run_cell_magic("timeit", "-n1 f(2)", "f(3)") |
|
653 |
self.assertEqual(called, |
|
|
653 | self.assertEqual(called, {-2, -3}) | |
|
654 | 654 | |
|
655 | 655 | def test_time(self): |
|
656 | 656 | called = [] |
@@ -718,12 +718,12 b' class TestAstTransform2(unittest.TestCase):' | |||
|
718 | 718 | |
|
719 | 719 | with tt.AssertPrints("best of "): |
|
720 | 720 | ip.run_line_magic("timeit", "-n1 f(1)") |
|
721 |
self.assertEqual(called, |
|
|
721 | self.assertEqual(called, {(1,)}) | |
|
722 | 722 | called.clear() |
|
723 | 723 | |
|
724 | 724 | with tt.AssertPrints("best of "): |
|
725 | 725 | ip.run_cell_magic("timeit", "-n1 f(2)", "f(3)") |
|
726 |
self.assertEqual(called, |
|
|
726 | self.assertEqual(called, {(2,), (3,)}) | |
|
727 | 727 | |
|
728 | 728 | class ErrorTransformer(ast.NodeTransformer): |
|
729 | 729 | """Throws an error when it sees a number.""" |
@@ -799,12 +799,12 b' def test_user_variables():' | |||
|
799 | 799 | ip.display_formatter.active_types = ip.display_formatter.format_types |
|
800 | 800 | |
|
801 | 801 | ip.user_ns['dummy'] = d = DummyRepr() |
|
802 |
keys = |
|
|
802 | keys = {'dummy', 'doesnotexist'} | |
|
803 | 803 | r = ip.user_expressions({ key:key for key in keys}) |
|
804 | 804 | |
|
805 | 805 | nt.assert_equal(keys, set(r.keys())) |
|
806 | 806 | dummy = r['dummy'] |
|
807 |
nt.assert_equal( |
|
|
807 | nt.assert_equal({'status', 'data', 'metadata'}, set(dummy.keys())) | |
|
808 | 808 | nt.assert_equal(dummy['status'], 'ok') |
|
809 | 809 | data = dummy['data'] |
|
810 | 810 | metadata = dummy['metadata'] |
@@ -832,7 +832,7 b' def test_user_expression():' | |||
|
832 | 832 | pprint.pprint(r) |
|
833 | 833 | nt.assert_equal(set(r.keys()), set(query.keys())) |
|
834 | 834 | a = r['a'] |
|
835 |
nt.assert_equal( |
|
|
835 | nt.assert_equal({'status', 'data', 'metadata'}, set(a.keys())) | |
|
836 | 836 | nt.assert_equal(a['status'], 'ok') |
|
837 | 837 | data = a['data'] |
|
838 | 838 | metadata = a['metadata'] |
@@ -144,7 +144,7 b' def test_list_profiles_in():' | |||
|
144 | 144 | break |
|
145 | 145 | if dec.unicode_paths: |
|
146 | 146 | nt.assert_true(found_unicode) |
|
147 |
nt.assert_equal(set(profiles), |
|
|
147 | nt.assert_equal(set(profiles), {'foo', 'hello'}) | |
|
148 | 148 | |
|
149 | 149 | |
|
150 | 150 | def test_list_bundled_profiles(): |
General Comments 0
You need to be logged in to leave comments.
Login now