Merge pull request #1608 from Kodiologist/astor-update
Re-enable tests that were stymied by an astor bug
This commit is contained in:
commit
d16a0bb395
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import math, itertools
|
import math, itertools
|
||||||
from hy import mangle
|
from hy import mangle
|
||||||
from hy._compat import PY36, PY37
|
from hy._compat import PY36
|
||||||
|
|
||||||
|
|
||||||
def test_direct_import():
|
def test_direct_import():
|
||||||
@ -24,8 +24,6 @@ def test_hy2py_import(tmpdir):
|
|||||||
|
|
||||||
def assert_stuff(m):
|
def assert_stuff(m):
|
||||||
|
|
||||||
astor_issue101_workaround = PY37
|
|
||||||
|
|
||||||
assert m.mystring == "foofoofoo"
|
assert m.mystring == "foofoofoo"
|
||||||
|
|
||||||
assert m.long_string == u"This is a very long string literal, which would surely exceed any limitations on how long a line or a string literal can be. The string literal alone exceeds 256 characters. It also has a character outside the Basic Multilingual Plane: 😂. Here's a double quote: \". Here are some escaped newlines:\n\n\nHere is a literal newline:\nCall me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation. Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; whenever I find myself involuntarily pausing before coffin warehouses, and bringing up the rear of every funeral I meet; and especially whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent me from deliberately stepping into the street, and methodically knocking people’s hats off—then, I account it high time to get to sea as soon as I can. This is my substitute for pistol and ball. With a philosophical flourish Cato throws himself upon his sword; I quietly take to the ship. There is nothing surprising in this. If they but knew it, almost all men in their degree, some time or other, cherish very nearly the same feelings towards the ocean with me."
|
assert m.long_string == u"This is a very long string literal, which would surely exceed any limitations on how long a line or a string literal can be. The string literal alone exceeds 256 characters. It also has a character outside the Basic Multilingual Plane: 😂. Here's a double quote: \". Here are some escaped newlines:\n\n\nHere is a literal newline:\nCall me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation. Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; whenever I find myself involuntarily pausing before coffin warehouses, and bringing up the rear of every funeral I meet; and especially whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent me from deliberately stepping into the street, and methodically knocking people’s hats off—then, I account it high time to get to sea as soon as I can. This is my substitute for pistol and ball. With a philosophical flourish Cato throws himself upon his sword; I quietly take to the ship. There is nothing surprising in this. If they but knew it, almost all men in their degree, some time or other, cherish very nearly the same feelings towards the ocean with me."
|
||||||
@ -91,7 +89,6 @@ def assert_stuff(m):
|
|||||||
assert m.ran_try_else is True
|
assert m.ran_try_else is True
|
||||||
|
|
||||||
assert type(m.fun) is type(lambda x: x)
|
assert type(m.fun) is type(lambda x: x)
|
||||||
if not astor_issue101_workaround:
|
|
||||||
assert m.fun.__doc__ == "function docstring"
|
assert m.fun.__doc__ == "function docstring"
|
||||||
assert m.funcall1 == [
|
assert m.funcall1 == [
|
||||||
1, 2, 3, 4, ("a", "b", "c"), [("k1", "v1"), ("k2", "v2")]]
|
1, 2, 3, 4, ("a", "b", "c"), [("k1", "v1"), ("k2", "v2")]]
|
||||||
@ -106,7 +103,6 @@ def assert_stuff(m):
|
|||||||
class C: pass
|
class C: pass
|
||||||
assert type(m.C1) is type(C)
|
assert type(m.C1) is type(C)
|
||||||
|
|
||||||
if not astor_issue101_workaround:
|
|
||||||
assert m.C2.__doc__ == "class docstring"
|
assert m.C2.__doc__ == "class docstring"
|
||||||
assert issubclass(m.C2, m.C1)
|
assert issubclass(m.C2, m.C1)
|
||||||
assert (m.C2.attr1, m.C2.attr2, m.C2.attr3) == (5, 6, 7)
|
assert (m.C2.attr1, m.C2.attr2, m.C2.attr3) == (5, 6, 7)
|
||||||
|
Loading…
Reference in New Issue
Block a user