mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Python: Run tests for fieldflow/test.py
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
import sys
|
||||
import os
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.dirname((__file__))))
|
||||
from testlib import *
|
||||
|
||||
# These are defined so that we can evaluate the test code.
|
||||
NONSOURCE = "not a source"
|
||||
SOURCE = "source"
|
||||
@@ -37,12 +43,13 @@ class NestedObj(object):
|
||||
def getObj(self):
|
||||
return self.obj
|
||||
|
||||
# Actual tests
|
||||
|
||||
def setFoo(obj, x):
|
||||
SINK_F(obj.foo)
|
||||
obj.foo = x
|
||||
|
||||
|
||||
@expects(2)
|
||||
def test_example1():
|
||||
myobj = MyObj("OK")
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ if __name__ == "__main__":
|
||||
check_tests_valid("variable-capture.nonlocal")
|
||||
check_tests_valid("variable-capture.dict")
|
||||
check_tests_valid("module-initialization.multiphase")
|
||||
check_tests_valid("fieldflow.test")
|
||||
|
||||
# The below will fail unless we use Python 3.10 or newer.
|
||||
# check_tests_valid("match.test")
|
||||
|
||||
Reference in New Issue
Block a user