Mark expected failing tests as failing.
# Idea and structure are taken from the pyChecco project, see:
# https://github.com/ipsw1/pychecco
+import pytest
from bytecode import BasicBlock, Compare, Instr
from tests.slicer.util import (
@@ -18,7 +19,7 @@ from tests.slicer.util import (
)
-# TODO(SiL) was marked as 'ExpectedFailure', how to adjust?
+@pytest.mark.xfail
def test_data_dependency_composite():
# Composite type dependencies, which are way too broad
def func():
@@ -55,7 +56,7 @@ def test_data_dependency_composite():
assert compare(dynamic_slice.sliced_instructions, expected_instructions)
-# TODO(SiL) was marked as 'ExpectedFailure', how to adjust?
+@pytest.mark.xfail
def test_dunder_definition():
def func():
class NestedClass:
@@ -125,6 +126,7 @@ def test_dunder_definition():
# TODO(SiL) was marked as 'ExpectedFailure', how to adjust?
+@pytest.mark.xfail
def test_mod_untraced_object():
def func():
lst = [("foo", "3"), ("bar", "1"), ("foobar", "2")]
@@ -163,7 +165,7 @@ def test_mod_untraced_object():
assert compare(dynamic_slice.sliced_instructions, expected_instructions)
-# TODO(SiL) was marked as 'ExpectedFailure', how to adjust?
+@pytest.mark.xfail
def test_call_unused_argument():
# Call with two arguments, one of which is used in the callee
@@ -215,7 +217,7 @@ def test_call_unused_argument():
assert compare(dynamic_slice.sliced_instructions, expected_instructions)
-# TODO(SiL) was marked as 'ExpectedFailure', how to adjust?
+@pytest.mark.xfail
def test_exception():
# Exception
def func():
@@ -287,13 +289,12 @@ def test_exception():
assert compare(dynamic_slice.sliced_instructions, expected_instructions)
-# TODO(SiL) was marked as 'ExpectedFailure', how to adjust?
+@pytest.mark.xfail
def test_import_star():
module_dependency = "tests.fixtures.slicer.import_star_def"
# IMPORT_STAR with access to immutable variable
main_module_block = BasicBlock(
[
- # TODO(SiL) adjust paths
# from tests.slicer.example_modules.import_star_def import *
Instr("IMPORT_NAME", module_dependency),
Instr("IMPORT_STAR"),
