Skip to content

Commit 6ed7b3d

Browse files
committed
Python: Add tests to illustrate shortcomings of current tests filter
1 parent 6685a5e commit 6ed7b3d

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
| Class MyTest |
2-
| Function test_1 |
3-
| Function test_2 |
1+
| test.py:4:1:4:23 | Class MyTest |
2+
| test.py:6:5:6:21 | Function test_1 |
3+
| test.py:9:5:9:21 | Function test_2 |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import python
22
import semmle.python.filters.Tests
33

44
from TestScope t
5-
select t.toString()
5+
select t

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
class TestCase:
42
pass
53

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This is running under some unknown framework, but is clearly a test!
2+
3+
def test_foo():
4+
assert True
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import unittest
2+
3+
class FooTest(unittest.TestCase):
4+
def test_valid(self):
5+
pass

0 commit comments

Comments
 (0)