Skip to content

Commit a5dc4f4

Browse files
committed
Python: Expand test-filter tests
With no virtual environment enabled, none of the third-party library test case are found.
1 parent 7d171f8 commit a5dc4f4

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

python/ql/test/library-tests/filters/tests/Filter.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
| test_foo.py:3:1:3:15 | Function test_foo |
55
| unittest_test.py:3:1:3:33 | Class FooTest |
66
| unittest_test.py:4:5:4:25 | Function test_valid |
7+
| unittest_test.py:7:1:7:49 | Class FunctionFooTest |
8+
| unittest_test.py:8:5:8:25 | Function test_valid |

python/ql/test/library-tests/filters/tests/unittest_test.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,29 @@
33
class FooTest(unittest.TestCase):
44
def test_valid(self):
55
pass
6+
7+
class FunctionFooTest(unittest.FunctionTestCase):
8+
def test_valid(self):
9+
pass
10+
11+
class AsyncTest(unittest.IsolatedAsyncioTestCase):
12+
async def test_valid(self):
13+
pass
14+
15+
# django -- see https://docs.djangoproject.com/en/4.0/topics/testing/overview/
16+
import django.test
17+
class MyDjangoUnitTest(django.test.TestCase):
18+
def test_valid(self):
19+
pass
20+
21+
# flask -- see https://pythonhosted.org/Flask-Testing/
22+
import flask_testing
23+
class MyFlaskUnitTest(flask_testing.LiveServerTestCase):
24+
def test_valid(self):
25+
pass
26+
27+
# tornado -- see https://www.tornadoweb.org/en/stable/testing.html#tornado.testing.AsyncHTTPTestCase
28+
import tornado.testing
29+
class MyTornadoUnitTest(tornado.testing.AsyncHTTPTestCase):
30+
def test_valid(self):
31+
pass

0 commit comments

Comments
 (0)