- syntaxerror_failing_test.patch (from

fdd4ad9..4d33cc6).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bpython?expand=0&rev=22
This commit is contained in:
2022-02-02 22:02:33 +00:00
committed by Git OBS Bridge
parent bee9ade68e
commit 5104e34cdf
3 changed files with 63 additions and 16 deletions

View File

@@ -1,19 +1,65 @@
---
bpython/test/test_interpreter.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From b46afa3bb1ab783c96dc80c5184090a171ab70d4 Mon Sep 17 00:00:00 2001
From: Sebastian Ramacher <sebastian@ramacher.at>
Date: Fri, 31 Dec 2021 14:00:46 +0100
Subject: [PATCH 1/3] Apply black
---
bpython/autocomplete.py | 1 -
bpython/curtsiesfrontend/filewatch.py | 1 -
bpython/test/test_interpreter.py | 14 +++++++++++++-
bpython/urwid.py | 1 -
4 files changed, 13 insertions(+), 4 deletions(-)
--- a/bpython/autocomplete.py
+++ b/bpython/autocomplete.py
@@ -626,7 +626,6 @@ except ImportError:
def locate(self, cursor_offset: int, line: str) -> Optional[LinePart]:
return None
-
else:
class JediCompletion(BaseCompletionType):
--- a/bpython/curtsiesfrontend/filewatch.py
+++ b/bpython/curtsiesfrontend/filewatch.py
@@ -11,7 +11,6 @@ except ImportError:
def ModuleChangedEventHandler(*args):
return None
-
else:
class ModuleChangedEventHandler(FileSystemEventHandler): # type: ignore [no-redef]
--- a/bpython/test/test_interpreter.py
+++ b/bpython/test/test_interpreter.py
@@ -41,10 +41,10 @@ class TestInterpreter(unittest.TestCase)
+ green('"<bpython-input-148>"')
+ ", line "
+ bold(magenta("1"))
- + "\n 1.1.1.1\n ^^^^^\n"
@@ -35,7 +35,19 @@ class TestInterpreter(unittest.TestCase)
i.runsource("1.1.1.1")
- if sys.version_info[:2] >= (3, 10):
+ if (3, 10, 1) <= sys.version_info[:3]:
+ expected = (
+ " File "
+ + green('"<bpython-input-148>"')
+ + ", line "
+ + bold(magenta("1"))
+ + "\n 1.1.1.1\n ^^\n"
+ bold(red("SyntaxError"))
+ ": "
- + cyan("invalid syntax. Perhaps you forgot a comma?")
+ + bold(red("SyntaxError"))
+ + ": "
+ + cyan("invalid syntax")
+ "\n"
)
elif (3, 8) <= sys.version_info[:2] <= (3, 9):
+ + "\n"
+ )
+ elif (3, 10) <= sys.version_info[:2]:
expected = (
" File "
+ green('"<bpython-input-148>"')
--- a/bpython/urwid.py
+++ b/bpython/urwid.py
@@ -128,7 +128,6 @@ if urwid.VERSION < (1, 0, 0) and hasattr
return wrapper
-
else:
TwistedEventLoop = getattr(urwid, "TwistedEventLoop", None)