Skip to content

Commit

Permalink
Merge pull request #311 from Carreau/cleanup-II
Browse files Browse the repository at this point in the history
Remove older python versions tests
  • Loading branch information
Carreau authored Feb 28, 2024
2 parents 2ed5282 + b30d1e1 commit 2cede72
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 95 deletions.
24 changes: 0 additions & 24 deletions tests/test_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,30 +495,6 @@ def test_tidy_imports_query_junk_1():
assert output == input


@pytest.mark.skip(reason="seem to fail at importing six even if installed")
def test_tidy_imports_py3_fallback():
input = dedent('''
import x
print 1
''')
with tempfile.NamedTemporaryFile(suffix=".py", mode='w+') as f:
f.write(input)
f.flush()
child = pexpect.spawn(python, [BIN_DIR+'/tidy-imports', f.name], timeout=5.0)
child.logfile = BytesIO()
child.expect_exact(" [y/N]")
child.send("n\n")
child.expect(pexpect.EOF)
with open(f.name) as f2:
output = f2.read()
proc_output = child.logfile.getvalue()
assert b"removed unused 'import x'" in proc_output
assert output == input
assert b"SyntaxError detected" in proc_output, proc_output
assert b"falling back" in proc_output, proc_output


def test_tidy_imports_symlinks_default():
input = dedent('''
import x
Expand Down
53 changes: 0 additions & 53 deletions tests/test_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -2410,59 +2410,6 @@ def test_complete_symbol_bad_as_1(frontend, tmp):
)


@pytest.mark.skipif(
sys.version_info < (3, 8),
reason="We're dropping support for 3, 7 anyways",
)
@retry
def test_complete_symbol_nonmodule_1(frontend, tmp):
# Verify that completion works even if a module replaced itself in
# sys.modules with a pseudo-module (perhaps in order to get module
# properties). E.g. psutil, https://github.com/josiahcarlson/mprop.
# As of 2015-10-02 (8438c54c), @properties now get evaluated twice, hence
# the repeated print output.
# TODO: Fix that. We can't avoid pyflyby evaluating the property. But is
# there some way to intercept ipython's subsequent evaluation and reuse
# the same result?
writetext(tmp.dir/"gravesend60063393.py", """
import sys
river = 'Thames'
class M(object):
@property
def river(self):
print("in the river")
return 'Medway'
@property
def island(self):
print("on the island")
return 'Canvey'
__name__ = __name__
sys.modules[__name__] = M()
""")

if IPython.version_info >= (8, 6):
extra_comp = '\n in the river'
else:
extra_comp = ''

# we use "... the island" as there might be prompt inserted by previous tab completino
ipython(
"""
In [1]: import pyflyby; pyflyby.enable_auto_importer()
[PYFLYBY] import gravesend60063393
In [2]: print(gravesend60063\t393.r\tiver){}
in the river
Medway
In [3]: print(gravesend600633\t93.isl\tand)
on the island
on the island
Canvey
""".format(extra_comp),
PYTHONPATH=tmp.dir,
frontend=frontend,
)


def test_complete_symbol_getitem_1(frontend):
if frontend == "prompt_toolkit": pytest.skip()
if _IPYTHON_VERSION >= (5,): pytest.skip()
Expand Down
18 changes: 0 additions & 18 deletions tests/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,24 +1118,6 @@ def test_PythonBlock_no_auto_flags_pn_futpf_1():
assert (block.source_flags & "print_function")


def test_PythonBlock_auto_flags_ps_flagpf_futpf_1():
block = PythonBlock(dedent('''
from __future__ import print_function
print 42
''').lstrip(), flags="print_function", auto_flags=True)
with pytest.raises(SyntaxError):
block.ast_node


def test_PythonBlock_auto_flags_ps_flagps_futpf_1():
block = PythonBlock(dedent('''
from __future__ import print_function
print 42
''').lstrip(), auto_flags=True)
with pytest.raises(SyntaxError):
block.ast_node


def test_PythonBlock_auto_flags_pf_flagps_1():
block = PythonBlock(dedent('''
print(42, out=x)
Expand Down

0 comments on commit 2cede72

Please sign in to comment.