| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 18f6901 commit 5ab3087
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,11 +1,14 @@ | |||
| 1 | 1 | import os | |
| 2 | + import sys | ||
| 2 | 3 | import unittest | |
| 3 | 4 | ||
| 4 | 5 | from bpython import inspection | |
| 5 | 6 | from bpython.test.fodder import encoding_ascii | |
| 6 | 7 | from bpython.test.fodder import encoding_latin1 | |
| 7 | 8 | from bpython.test.fodder import encoding_utf8 | |
| 8 | 9 | ||
| 10 | + pypy = "PyPy" in sys.version | ||
| 11 | + | ||
| 9 | 12 | try: | |
| 10 | 13 | import numpy | |
| 11 | 14 | except ImportError: | |
@@ -118,6 +121,7 @@ def test_get_source_file(self): | |||
| 118 | 121 | ) | |
| 119 | 122 | self.assertEqual(encoding, "utf-8") | |
| 120 | 123 | ||
| 124 | + @unittest.skipIf(pypy, "pypy builtin signatures aren't complete") | ||
| 121 | 125 | def test_getfuncprops_print(self): | |
| 122 | 126 | props = inspection.getfuncprops("print", print) | |
| 123 | 127 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,7 +53,7 @@ def test_syntaxerror(self): | |||
| 53 | 53 | + green('"<input>"') | |
| 54 | 54 | + ", line " | |
| 55 | 55 | + bold(magenta("1")) | |
| 56 | - + "\n 1.1.1.1\n ^\n" | ||
| 56 | + + "\n 1.1.1.1\n ^\n" | ||
| 57 | 57 | + bold(red("SyntaxError")) | |
| 58 | 58 | + ": " | |
| 59 | 59 | + cyan("invalid syntax") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -157,7 +157,8 @@ def set_input_line(self, line): | |||
| 157 | 157 | def test_func_name(self): | |
| 158 | 158 | for (line, expected_name) in [ | |
| 159 | 159 | ("spam(", "spam"), | |
| 160 | - ("spam(map([]", "map"), | ||
| 160 | + # map pydoc has no signature in pypy | ||
| 161 | + ("spam(any([]", "any") if pypy else ("spam(map([]", "map"), | ||
| 161 | 162 | ("spam((), ", "spam"), | |
| 162 | 163 | ]: | |
| 163 | 164 | self.set_input_line(line) | |
@@ -167,7 +168,8 @@ def test_func_name(self): | |||
| 167 | 168 | def test_func_name_method_issue_479(self): | |
| 168 | 169 | for (line, expected_name) in [ | |
| 169 | 170 | ("o.spam(", "spam"), | |
| 170 | - ("o.spam(map([]", "map"), | ||
| 171 | + # map pydoc has no signature in pypy | ||
| 172 | + ("o.spam(any([]", "any") if pypy else ("o.spam(map([]", "map"), | ||
| 171 | 173 | ("o.spam((), ", "spam"), | |
| 172 | 174 | ]: | |
| 173 | 175 | self.set_input_line(line) | |
@@ -200,6 +202,7 @@ def test_lambda_position(self): | |||
| 200 | 202 | # Argument position | |
| 201 | 203 | self.assertEqual(self.repl.arg_pos, 1) | |
| 202 | 204 | ||
| 205 | + @unittest.skipIf(pypy, "range pydoc has no signature in pypy") | ||
| 203 | 206 | def test_issue127(self): | |
| 204 | 207 | self.set_input_line("x=range(") | |
| 205 | 208 | self.assertTrue(self.repl.get_args()) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments