Skip to content

Commit

Permalink
tests: ida: don't collect tests as pytest tests
Browse files Browse the repository at this point in the history
closes #1719
  • Loading branch information
williballenthin authored Aug 15, 2023
1 parent 3169ee2 commit 408c507
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_ida_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ def get_ida_extractor(_path):
return capa.features.extractors.ida.extractor.IdaFeatureExtractor()


def nocollect(f):
"don't collect the decorated function as a pytest test"
f.__test__ = False
return f


# although these look like pytest tests, they're not, because they doesn't run within pytest
# (the runner is below) and they use `yield`, which is deprecated.
@nocollect
@pytest.mark.skip(reason="IDA Pro tests must be run within IDA")
def test_ida_features():
# we're guaranteed to be in a function here, so there's a stack frame
Expand All @@ -118,6 +127,7 @@ def test_ida_features():
yield this_name, id, "pass", None


@nocollect
@pytest.mark.skip(reason="IDA Pro tests must be run within IDA")
def test_ida_feature_counts():
# we're guaranteed to be in a function here, so there's a stack frame
Expand Down

0 comments on commit 408c507

Please sign in to comment.